summaryrefslogtreecommitdiff
path: root/bin/install_scons.py
diff options
context:
space:
mode:
authorLuca Falavigna <dktrkranz@debian.org>2011-02-10 23:18:10 +0100
committerLuca Falavigna <dktrkranz@debian.org>2011-02-10 23:18:10 +0100
commit84c6f9729dbbc175431874957d0654310410bd6f (patch)
treef1bc4ac49739eaa417eb3c79d794a5c5865dad22 /bin/install_scons.py
parent738149c9bfb9965d013d01ef99f9bb1c2819e7e8 (diff)
Imported Upstream version 2.0.1upstream/2.0.1
Diffstat (limited to 'bin/install_scons.py')
-rw-r--r--bin/install_scons.py24
1 files changed, 19 insertions, 5 deletions
diff --git a/bin/install_scons.py b/bin/install_scons.py
index b5e0af8..00129f6 100644
--- a/bin/install_scons.py
+++ b/bin/install_scons.py
@@ -22,6 +22,8 @@ import getopt
import os
import shutil
import sys
+import tarfile
+import urllib
from Command import CommandRunner, Usage
@@ -87,7 +89,12 @@ all_versions = [
'1.3.0',
'1.3.0.d20100404',
'1.3.0.d20100501',
+ '1.3.0.d20100523',
+ '1.3.0.d20100606',
'2.0.0.alpha.20100508',
+ '2.0.0.beta.20100531',
+ '2.0.0.beta.20100605',
+ '2.0.0.final.0',
]
def main(argv=None):
@@ -97,8 +104,12 @@ def main(argv=None):
all = False
downloads_dir = 'Downloads'
downloads_url = 'http://downloads.sourceforge.net/scons'
- sudo = 'sudo'
- prefix = '/usr/local'
+ if sys.platform == 'win32':
+ sudo = ''
+ prefix = sys.prefix
+ else:
+ sudo = 'sudo'
+ prefix = '/usr/local'
python = sys.executable
short_options = 'ad:hnp:q'
@@ -153,16 +164,19 @@ Usage: install_scons.py [-ahnq] [-d DIR] [-p PREFIX] [VERSION ...]
for version in args:
scons = 'scons-' + version
tar_gz = os.path.join(downloads_dir, scons + '.tar.gz')
- tar_gz_url = os.path.join(downloads_url, scons + '.tar.gz')
+ tar_gz_url = "%s/%s.tar.gz" % (downloads_url, scons)
cmd.subst_dictionary(locals())
if not os.path.exists(tar_gz):
if not os.path.exists(downloads_dir):
cmd.run('mkdir %(downloads_dir)s')
- cmd.run('wget -O %(tar_gz)s %(tar_gz_url)s')
+ cmd.run((urllib.urlretrieve, tar_gz_url, tar_gz),
+ 'wget -O %(tar_gz)s %(tar_gz_url)s')
- cmd.run('tar zxf %(tar_gz)s')
+ def extract(tar_gz):
+ tarfile.open(tar_gz, "r:gz").extractall()
+ cmd.run((extract, tar_gz), 'tar zxf %(tar_gz)s')
cmd.run('cd %(scons)s')