summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2009-02-19 05:58:40 (GMT)
committerSteven Knight <knight@baldmt.com>2009-02-19 05:58:40 (GMT)
commit29ad561d6bb373384273e24047efa79a88d406e7 (patch)
tree1d23d7c44adbd0e2664b36eded3ae93876ae8500 /bin
parentcfe6f670564137abdd937f994a4557f653e911b9 (diff)
downloadSCons-29ad561d6bb373384273e24047efa79a88d406e7.zip
SCons-29ad561d6bb373384273e24047efa79a88d406e7.tar.gz
SCons-29ad561d6bb373384273e24047efa79a88d406e7.tar.bz2
dd newer SCons versions to the list of all versions available for install.
Use shlex.split(), not string.split(), to split command line arguments. Commonize interpreation of 'cd' and 'mkdir' commands. Fix usage messages.
Diffstat (limited to 'bin')
-rw-r--r--bin/Command.py14
-rw-r--r--bin/install_python.py13
-rw-r--r--bin/install_scons.py18
3 files changed, 28 insertions, 17 deletions
diff --git a/bin/Command.py b/bin/Command.py
index b47e896..efaa356 100644
--- a/bin/Command.py
+++ b/bin/Command.py
@@ -7,6 +7,7 @@
import getopt
import os
+import shlex
import sys
class Usage(Exception):
@@ -58,12 +59,19 @@ class CommandRunner:
pass
def do_execute(self, command):
+ if type(command) == type(''):
+ command = self.subst(command)
+ cmdargs = shlex.split(command)
+ if cmdargs[0] == 'cd':
+ command = (os.chdir,) + tuple(cmdargs[1:])
+ elif cmdargs[0] == 'mkdir':
+ command = (os.mkdir,) + tuple(cmdargs[1:])
if type(command) == type(()):
func = command[0]
args = command[1:]
return func(*args)
else:
- return os.system(self.subst(command))
+ return os.system(command)
def do_not_execute(self, command):
pass
@@ -94,8 +102,8 @@ def main(argv=None):
Usage: script-template.py [-hnq]
-h, --help Print this help and exit
- -n, --no-exec No execute, just print the command line
- -q, --quiet Quiet, don't print the command line
+ -n, --no-exec No execute, just print command lines
+ -q, --quiet Quiet, don't print command lines
"""
try:
diff --git a/bin/install_python.py b/bin/install_python.py
index fff834c..ca1c8b7 100644
--- a/bin/install_python.py
+++ b/bin/install_python.py
@@ -39,14 +39,14 @@ def main(argv=None):
long_options = ['all', 'help', 'no-exec', 'prefix=', 'quiet']
helpstr = """\
-sage: installs-scons.py [-ahnq] [-d DIR] [-p PREFIX] [VERSION ...]
+Usage: install_python.py [-ahnq] [-d DIR] [-p PREFIX] [VERSION ...]
-a, --all Install all SCons versions.
-d DIR, --downloads=DIR Downloads directory.
-h, --help Print this help and exit
- -n, --no-exec No execute, just print the command line
+ -n, --no-exec No execute, just print command lines
-p PREFIX, --prefix=PREFIX Installation prefix.
- -q, --quiet Quiet, don't print the command line
+ -q, --quiet Quiet, don't print command lines
"""
try:
@@ -103,13 +103,12 @@ sage: installs-scons.py [-ahnq] [-d DIR] [-p PREFIX] [VERSION ...]
if not os.path.exists(tar_gz):
if not os.path.exists(downloads_dir):
- cmd.run((os.mkdir, downloads_dir),
- 'mkdir %(downloads_dir)s')
+ cmd.run('mkdir %(downloads_dir)s')
cmd.run('wget -O %(tar_gz)s %(tar_gz_url)s')
cmd.run('tar zxf %(tar_gz)s')
- cmd.run((os.chdir, python), 'cd %(python)s')
+ cmd.run('cd %(python)s')
if (version.startswith('1.6') or
version.startswith('2.0')):
@@ -128,7 +127,7 @@ sage: installs-scons.py [-ahnq] [-d DIR] [-p PREFIX] [VERSION ...]
cmd.run('%(sudo)s rm -f %(prefix)s/bin/{idle,pydoc,python,python-config,smtpd.py}')
- cmd.run((os.chdir, '..'), 'cd ..')
+ cmd.run('cd ..')
cmd.run((shutil.rmtree, python), 'rm -rf %(python)s')
diff --git a/bin/install_scons.py b/bin/install_scons.py
index 71e6477..34bc799 100644
--- a/bin/install_scons.py
+++ b/bin/install_scons.py
@@ -73,6 +73,11 @@ all_versions = [
'1.0.1.d20080915',
'1.0.1.d20081001',
'1.1.0',
+ '1.1.0.d20081104',
+ '1.1.0.d20081125',
+ '1.1.0.d20081207',
+ '1.2.0',
+ '1.2.0.d20090113',
]
def main(argv=None):
@@ -90,14 +95,14 @@ def main(argv=None):
long_options = ['all', 'help', 'no-exec', 'prefix=', 'quiet']
helpstr = """\
-Usage: install-scons.py [-ahnq] [-d DIR] [-p PREFIX] [VERSION ...]
+Usage: install_scons.py [-ahnq] [-d DIR] [-p PREFIX] [VERSION ...]
-a, --all Install all SCons versions.
-d DIR, --downloads=DIR Downloads directory.
-h, --help Print this help and exit
- -n, --no-exec No execute, just print the command line
+ -n, --no-exec No execute, just print command lines
-p PREFIX, --prefix=PREFIX Installation prefix.
- -q, --quiet Quiet, don't print the command line
+ -q, --quiet Quiet, don't print command lines
"""
try:
@@ -144,13 +149,12 @@ Usage: install-scons.py [-ahnq] [-d DIR] [-p PREFIX] [VERSION ...]
if not os.path.exists(tar_gz):
if not os.path.exists(downloads_dir):
- cmd.run((os.mkdir, downloads_dir),
- 'mkdir %(downloads_dir)s')
+ cmd.run('mkdir %(downloads_dir)s')
cmd.run('wget -O %(tar_gz)s %(tar_gz_url)s')
cmd.run('tar zxf %(tar_gz)s')
- cmd.run((os.chdir, scons), 'cd %(scons)s')
+ cmd.run('cd %(scons)s')
if version in ('0.01', '0.02', '0.03', '0.04', '0.05',
'0.06', '0.07', '0.08', '0.09', '0.10'):
@@ -197,7 +201,7 @@ Usage: install-scons.py [-ahnq] [-d DIR] [-p PREFIX] [VERSION ...]
cmd.run('%(python)s setup.py build')
cmd.run('%(sudo)s %(python)s setup.py install --prefix=%(prefix)s --no-scons-script')
- cmd.run((os.chdir, '..'), 'cd ..')
+ cmd.run('cd ..')
cmd.run((shutil.rmtree, scons), 'rm -rf %(scons)s')