Skip to content

Commit 739ebdb

Browse files
committed
---
yaml --- r: 11478 b: refs/heads/master c: be99146 h: refs/heads/master v: v3
1 parent 53f83e7 commit 739ebdb

File tree

3 files changed

+25
-15
lines changed

3 files changed

+25
-15
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: 8e4c5d2d4d65253a527742ac9ef40a3f6ca5c3a0
2+
refs/heads/master: be9914625b0cbf5f305c5af3adbc6bc337ae760e
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/mk/stage0.mk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ $(HBIN0_H_$(CFG_HOST_TRIPLE))/rustc$(X): \
44
$(S)src/snapshots.txt \
55
$(S)src/etc/get-snapshot.py $(MKFILE_DEPS)
66
@$(call E, fetch: $@)
7-
$(Q)$(S)src/etc/get-snapshot.py $(CFG_HOST_TRIPLE)
7+
# Note: the variable "SNAPSHOT_FILE" is generally not set, and so
8+
# we generally only pass one argument to this script.
9+
$(Q)$(S)src/etc/get-snapshot.py $(CFG_HOST_TRIPLE) $(SNAPSHOT_FILE)
810
$(Q)touch $@
911

1012
# Host libs will be extracted by the above rule

trunk/src/etc/get-snapshot.py

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
import os, tarfile, hashlib, re, shutil, sys
44
from snapshot import *
55

6-
def unpack_snapshot(triple, snap):
7-
dl_path = os.path.join(download_dir_base, snap)
6+
def unpack_snapshot(triple, dl_path):
87
print("opening snapshot " + dl_path)
98
tar = tarfile.open(dl_path)
109
kernel = get_kernel(triple)
@@ -60,18 +59,27 @@ def determine_curr_snapshot(triple):
6059

6160
# Main
6261

62+
# this gets called with one or two arguments:
63+
# The first is the O/S triple.
64+
# The second is an optional path to the snapshot to use.
65+
6366
triple = sys.argv[1]
64-
snap = determine_curr_snapshot(triple)
65-
dl = os.path.join(download_dir_base, snap)
66-
url = download_url_base + "/" + snap
67-
print("determined most recent snapshot: " + snap)
67+
if len(sys.argv) == 3:
68+
dl_path = sys.argv[2]
69+
else:
70+
snap = determine_curr_snapshot(triple)
71+
dl = os.path.join(download_dir_base, snap)
72+
url = download_url_base + "/" + snap
73+
print("determined most recent snapshot: " + snap)
6874

69-
if (not os.path.exists(dl)):
70-
get_url_to_file(url, dl)
75+
if (not os.path.exists(dl)):
76+
get_url_to_file(url, dl)
7177

72-
if (snap_filename_hash_part(snap) == hash_file(dl)):
73-
print("got download with ok hash")
74-
else:
75-
raise Exception("bad hash on download")
78+
if (snap_filename_hash_part(snap) == hash_file(dl)):
79+
print("got download with ok hash")
80+
else:
81+
raise Exception("bad hash on download")
82+
83+
dl_path = os.path.join(download_dir_base, snap)
7684

77-
unpack_snapshot(triple, snap)
85+
unpack_snapshot(triple, dl_path)

0 commit comments

Comments
 (0)