update snapshot scripts

This commit is contained in:
Niko Matsakis 2011-11-28 06:06:32 -08:00
parent 4b13fdbf27
commit 44ccc36d93
4 changed files with 23 additions and 24 deletions

View File

@ -1,9 +1,9 @@
snap-stage1: $(HSREQ1_H_$(CFG_HOST_TRIPLE))
$(S)src/etc/make-snapshot.py $(CFG_HOST_TRIPLE)/stage1
$(S)src/etc/make-snapshot.py stage1 $(CFG_HOST_TRIPLE)
snap-stage2: $(HSREQ2_H_$(CFG_HOST_TRIPLE)
$(S)src/etc/make-snapshot.py $(CFG_HOST_TRIPLE)/stage2
$(S)src/etc/make-snapshot.py stage2 $(CFG_HOST_TRIPLE)
snap-stage3: $(HSREQ3_H_$(CFG_HOST_TRIPLE)
$(S)src/etc/make-snapshot.py $(CFG_HOST_TRIPLE)/stage3
$(S)src/etc/make-snapshot.py stage3 $(CFG_HOST_TRIPLE)

View File

@ -20,10 +20,9 @@ def unpack_snapshot(snap):
tar.close()
shutil.rmtree(download_unpack_base)
def determine_curr_snapshot_for_platform():
def determine_curr_snapshot(triple):
i = 0
platform = get_platform()
platform = get_platform(triple)
found_file = False
found_snap = False

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python
import snapshot, sys
print(snapshot.make_snapshot(sys.argv[1]))
print(snapshot.make_snapshot(sys.argv[1], sys.argv[2]))

View File

@ -54,22 +54,22 @@ def full_snapshot_name(date, rev, platform, hsh):
% (date, rev, platform, hsh))
def get_kernel():
if os.name == "nt" or scrub(os.getenv("CFG_ENABLE_MINGW_CROSS")):
def get_kernel(triple):
os_name = triple.split('-')[-1]
if os_name == "nt" or scrub(os.getenv("CFG_ENABLE_MINGW_CROSS")):
return "winnt"
kernel = os.uname()[0].lower()
if kernel == "darwin":
kernel = "macos"
return kernel
if os_name == "darwin":
return "macos"
return "linux"
def get_cpu(triple):
arch = triple.split('-')[0]
if arch == "i686":
return "i386"
return arch
def get_cpu():
# return os.uname()[-1].lower()
return "i386"
def get_platform():
return "%s-%s" % (get_kernel(), get_cpu())
def get_platform(triple):
return "%s-%s" % (get_kernel(triple), get_cpu(triple))
def cmd_out(cmdline):
@ -110,9 +110,9 @@ def hash_file(x):
return scrub(h.hexdigest())
def make_snapshot(stage):
kernel = get_kernel()
platform = get_platform()
def make_snapshot(stage, triple):
kernel = get_kernel(triple)
platform = get_platform(triple)
rev = local_rev_short_sha()
date = local_rev_committer_date().split()[0]
@ -123,7 +123,7 @@ def make_snapshot(stage):
dir = stage
if stage == "stage1" and re.match(r"^lib/(lib)?std.*", name):
dir = "stage0"
tar.add(os.path.join(dir, name),
tar.add(os.path.join(triple, os.path.join(dir, name)),
"rust-stage0/" + name)
tar.close()