Skip to content

Commit 8098776

Browse files
committed
---
yaml --- r: 176991 b: refs/heads/master c: f230683 h: refs/heads/master i: 176989: 04566f6 176987: 33478e8 176983: 8ffe999 176975: 89945e4 176959: 4cde66d v: v3
1 parent d0f31e5 commit 8098776

File tree

2 files changed

+35
-35
lines changed

2 files changed

+35
-35
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 6af36031e2f286e6cca37f14ede514fff46b6e6f
2+
refs/heads/master: f230683b1a01500af3f74e3e357441c67b77c4b6
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a45e117733b866302fa99390553d1c548508dcca
55
refs/heads/try: fde4472848b662a4d1236388c4cf15e2450237e6

trunk/src/etc/get-snapshot.py

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,32 @@
1414
from snapshot import *
1515

1616
def unpack_snapshot(triple, dl_path):
17-
print("opening snapshot " + dl_path)
18-
tar = tarfile.open(dl_path)
19-
kernel = get_kernel(triple)
17+
print("opening snapshot " + dl_path)
18+
tar = tarfile.open(dl_path)
19+
kernel = get_kernel(triple)
2020

21-
stagep = os.path.join(triple, "stage0")
21+
stagep = os.path.join(triple, "stage0")
2222

23-
# Remove files from prior unpackings, since snapshot rustc may not
24-
# be able to disambiguate between multiple candidate libraries.
25-
# (Leave dirs in place since extracting step still needs them.)
26-
for root, _, files in os.walk(stagep):
27-
for f in files:
28-
print("removing " + os.path.join(root, f))
29-
os.unlink(os.path.join(root, f))
23+
# Remove files from prior unpackings, since snapshot rustc may not
24+
# be able to disambiguate between multiple candidate libraries.
25+
# (Leave dirs in place since extracting step still needs them.)
26+
for root, _, files in os.walk(stagep):
27+
for f in files:
28+
print("removing " + os.path.join(root, f))
29+
os.unlink(os.path.join(root, f))
3030

31-
for p in tar.getnames():
32-
name = p.replace("rust-stage0/", "", 1);
31+
for p in tar.getnames():
32+
name = p.replace("rust-stage0/", "", 1);
3333

34-
fp = os.path.join(stagep, name)
35-
print("extracting " + p)
36-
tar.extract(p, download_unpack_base)
37-
tp = os.path.join(download_unpack_base, p)
38-
if os.path.isdir(tp) and os.path.exists(fp):
39-
continue
40-
shutil.move(tp, fp)
41-
tar.close()
42-
shutil.rmtree(download_unpack_base)
34+
fp = os.path.join(stagep, name)
35+
print("extracting " + p)
36+
tar.extract(p, download_unpack_base)
37+
tp = os.path.join(download_unpack_base, p)
38+
if os.path.isdir(tp) and os.path.exists(fp):
39+
continue
40+
shutil.move(tp, fp)
41+
tar.close()
42+
shutil.rmtree(download_unpack_base)
4343

4444

4545
# Main
@@ -50,21 +50,21 @@ def unpack_snapshot(triple, dl_path):
5050

5151
triple = sys.argv[1]
5252
if len(sys.argv) == 3:
53-
dl_path = sys.argv[2]
53+
dl_path = sys.argv[2]
5454
else:
55-
snap = determine_curr_snapshot(triple)
56-
dl = os.path.join(download_dir_base, snap)
57-
url = download_url_base + "/" + snap
58-
print("determined most recent snapshot: " + snap)
55+
snap = determine_curr_snapshot(triple)
56+
dl = os.path.join(download_dir_base, snap)
57+
url = download_url_base + "/" + snap
58+
print("determined most recent snapshot: " + snap)
5959

60-
if (not os.path.exists(dl)):
61-
get_url_to_file(url, dl)
60+
if (not os.path.exists(dl)):
61+
get_url_to_file(url, dl)
6262

63-
if (snap_filename_hash_part(snap) == hash_file(dl)):
64-
print("got download with ok hash")
65-
else:
66-
raise Exception("bad hash on download")
63+
if (snap_filename_hash_part(snap) == hash_file(dl)):
64+
print("got download with ok hash")
65+
else:
66+
raise Exception("bad hash on download")
6767

68-
dl_path = os.path.join(download_dir_base, snap)
68+
dl_path = os.path.join(download_dir_base, snap)
6969

7070
unpack_snapshot(triple, dl_path)

0 commit comments

Comments
 (0)