Register new snapshots and teach snapshot script to deal with extracting new-style versioned snapshots.

This commit is contained in:
Graydon Hoare 2011-12-13 10:54:48 -08:00
parent 1c1bc2f1cd
commit 548fe0eda9
2 changed files with 10 additions and 21 deletions

View File

@ -3,34 +3,16 @@
import os, tarfile, hashlib, re, shutil, sys import os, tarfile, hashlib, re, shutil, sys
from snapshot import * from snapshot import *
old_snapshot_files = {
"linux": ["bin/rustc",
"lib/libcore.so",
"lib/libruststd.so",
"lib/librustrt.so",
"lib/librustllvm.so"],
"macos": ["bin/rustc",
"lib/libcore.dylib",
"lib/libruststd.dylib",
"lib/librustrt.dylib",
"lib/librustllvm.dylib"],
"winnt": ["bin/rustc.exe",
"lib/core.dll",
"lib/ruststd.dll",
"lib/rustrt.dll",
"lib/rustllvm.dll"]
}
def unpack_snapshot(triple, snap): def unpack_snapshot(triple, snap):
dl_path = os.path.join(download_dir_base, snap) dl_path = os.path.join(download_dir_base, snap)
print("opening snapshot " + dl_path) print("opening snapshot " + dl_path)
tar = tarfile.open(dl_path) tar = tarfile.open(dl_path)
kernel = get_kernel(triple) kernel = get_kernel(triple)
for name in old_snapshot_files[kernel]: for p in tar.getnames():
p = "rust-stage0/" + name name = p.replace("rust-stage0/", "", 1);
stagep = os.path.join(triple, "stage0") stagep = os.path.join(triple, "stage0")
fp = os.path.join(stagep, name) fp = os.path.join(stagep, name)
print("extracting " + fp) print("extracting " + p)
tar.extract(p, download_unpack_base) tar.extract(p, download_unpack_base)
tp = os.path.join(download_unpack_base, p) tp = os.path.join(download_unpack_base, p)
shutil.move(tp, fp) shutil.move(tp, fp)

View File

@ -1,3 +1,10 @@
S 2011-12-12 1c1bc2f
winnt-i386 550dc539e8ab6837c52b3a35e6119061490190b1
linux-i386 66c5e97e3072d8c88a52d986d1fadbd43de615a5
macos-i386 c3db65606d7bbea2ae0482b20e177f7463dc58ef
linux-x86_64 c5bbd08e423844ee938c8f6824ba2b3b4dc851b0
macos-x86_64 29accda0ace162169408357371482ddd044b6dd3
S 2011-12-07 3ccdd2a S 2011-12-07 3ccdd2a
linux-i386 7c639851d8a4ae43f781ad4592b6d3b6e0f4837b linux-i386 7c639851d8a4ae43f781ad4592b6d3b6e0f4837b
macos-i386 8fdf95481943aff1953d93eed31528c221d33373 macos-i386 8fdf95481943aff1953d93eed31528c221d33373