aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonan Amicel <ronan.amicel@gmail.com>2012-10-12 12:35:17 +0200
committerRonan Amicel <ronan.amicel@gmail.com>2012-10-13 12:22:48 +0200
commit26c55d69eff0454dbf6ad9650b5dbc3514cbe912 (patch)
tree43db13229971fb6cd550acbda0fb4ca9f84b2427
parentUpdate default Node.js version to 0.8.11 (diff)
downloadfabtools-26c55d69eff0454dbf6ad9650b5dbc3514cbe912.tar.xz
Python 2.5 compatibility
-rw-r--r--fabtools/nodejs.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/fabtools/nodejs.py b/fabtools/nodejs.py
index 157ab49..e7f808e 100644
--- a/fabtools/nodejs.py
+++ b/fabtools/nodejs.py
@@ -38,15 +38,15 @@ def install_nodejs(version=DEFAULT_VERSION):
"g++",
])
- filename = "node-v{version}.tar.gz".format(**locals())
+ filename = 'node-v%s.tar.gz' % version
foldername = filename[0:-7]
- run("wget http://nodejs.org/dist/v{version}/{filename}".format(**locals()))
- run("tar -xzf {filename}".format(filename=filename))
+ run('wget http://nodejs.org/dist/v%(version)s/%(filename)s' % locals())
+ run('tar -xzf %s' % filename)
with cd(foldername):
run("./configure ; make")
sudo("make install")
- run('rm {filename} ; rm -rf {foldername}'.format(**locals()))
+ run('rm %(filename)s ; rm -rf %(foldername)s' % locals())
def install(package=None, version=None, global_install=True):
@@ -72,12 +72,12 @@ def install(package=None, version=None, global_install=True):
"""
if package:
if version:
- package += "@{version}".format(version=version)
+ package += '@%s' % version
if global_install:
- sudo("npm install -g {package}".format(package=package))
+ sudo('npm install -g %s' % package)
else:
- run("npm install -l {package}".format(package=package))
+ run('npm install -l %s' % package)
else:
run("npm install")
@@ -87,9 +87,9 @@ def update(package, global_install=True):
Update Node.js package.
"""
if global_install:
- sudo("npm update -g {package}".format(package=package))
+ sudo('npm update -g %s' % package)
else:
- run("npm update -l {package}".format(package=package))
+ run('npm update -l %s' % package)
def uninstall(package, version=None, global_uninstall=True):
@@ -111,9 +111,9 @@ def uninstall(package, version=None, global_uninstall=True):
"""
if version:
- package += "@{version}".format(version=version)
+ package += '@%s' % version
if global_uninstall:
- sudo("npm uninstall -g {package}".format(package=package))
+ sudo('npm uninstall -g %s' % package)
else:
- sudo("npm uninstall -l {package}".format(package=package))
+ sudo('npm uninstall -l %s' % package)