diff options
| author | Tshepang Lekhonkhobe <tshepang@gmail.com> | 2016-04-21 23:07:51 +0200 |
|---|---|---|
| committer | Tshepang Lekhonkhobe <tshepang@gmail.com> | 2016-04-26 00:34:19 +0200 |
| commit | a422b7e4ed8bc8a05777eced718156f47eaa861b (patch) | |
| tree | 1df0c728b7d7b4353de1bb900829983025d3f4af /src/etc | |
| parent | a264f5b7e8df34c4bf7f10d0c6c7f9ab805ee672 (diff) | |
| download | rust-a422b7e4ed8bc8a05777eced718156f47eaa861b.tar.gz rust-a422b7e4ed8bc8a05777eced718156f47eaa861b.zip | |
some Python nits and fixes
Diffstat (limited to 'src/etc')
| -rw-r--r-- | src/etc/get-stage0.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/etc/get-stage0.py b/src/etc/get-stage0.py index 3a609957faf..6f3837d3b53 100644 --- a/src/etc/get-stage0.py +++ b/src/etc/get-stage0.py @@ -11,18 +11,15 @@ # except according to those terms. import os -import shutil import sys -import tarfile path = os.path.abspath(os.path.join(os.path.dirname(__file__), "../bootstrap")) sys.path.append(path) import bootstrap -def main(argv): +def main(triple): src_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "../..")) - triple = argv[1] data = bootstrap.stage0_data(src_root) channel, date = data['rustc'].split('-', 1) @@ -31,9 +28,8 @@ def main(argv): if not os.path.exists(dl_dir): os.makedirs(dl_dir) - filename_base = 'rustc-' + channel + '-' + triple - filename = filename_base + '.tar.gz' - url = 'https://static.rust-lang.org/dist/' + date + '/' + filename + filename = 'rustc-{}-{}.tar.gz'.format(channel, triple) + url = 'https://static.rust-lang.org/dist/{}/{}'.format(date, filename) dst = dl_dir + '/' + filename if not os.path.exists(dst): bootstrap.get(url, dst) @@ -48,4 +44,4 @@ def main(argv): bootstrap.unpack(dst, stage0_dst, match='rustc', verbose=True) if __name__ == '__main__': - main(sys.argv) + main(sys.argv[1]) |
