Skip to content

Commit 606144d

Browse files
committed
---
yaml --- r: 177765 b: refs/heads/snap-stage3 c: 958dea1 h: refs/heads/master i: 177763: 5a50ace v: v3
1 parent 738ef06 commit 606144d

File tree

2 files changed

+21
-17
lines changed

2 files changed

+21
-17
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 474b324eda10440d6568ef872a7307d38e7de95b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: f230683b1a01500af3f74e3e357441c67b77c4b6
4+
refs/heads/snap-stage3: 958dea1745b9000becaeed728f78daec3b9c13ba
55
refs/heads/try: fde4472848b662a4d1236388c4cf15e2450237e6
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/src/etc/get-snapshot.py

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -48,23 +48,27 @@ def unpack_snapshot(triple, dl_path):
4848
# The first is the O/S triple.
4949
# The second is an optional path to the snapshot to use.
5050

51-
triple = sys.argv[1]
52-
if len(sys.argv) == 3:
53-
dl_path = sys.argv[2]
54-
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)
51+
def main(argv):
52+
triple = argv[1]
53+
if len(argv) == 3:
54+
dl_path = argv[2]
55+
else:
56+
snap = determine_curr_snapshot(triple)
57+
dl = os.path.join(download_dir_base, snap)
58+
url = download_url_base + "/" + snap
59+
print("determined most recent snapshot: " + snap)
5960

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

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")
64+
if (snap_filename_hash_part(snap) == hash_file(dl)):
65+
print("got download with ok hash")
66+
else:
67+
raise Exception("bad hash on download")
68+
69+
dl_path = os.path.join(download_dir_base, snap)
6770

68-
dl_path = os.path.join(download_dir_base, snap)
71+
unpack_snapshot(triple, dl_path)
6972

70-
unpack_snapshot(triple, dl_path)
73+
if __name__ == '__main__':
74+
main(sys.argv)

0 commit comments

Comments
 (0)