Skip to content

Commit 07ee463

Browse files
bogglegraydon
authored andcommitted
---
yaml --- r: 6561 b: refs/heads/master c: 1b7f141 h: refs/heads/master i: 6559: 8d67489 v: v3
1 parent 6782868 commit 07ee463

File tree

4 files changed

+42
-3
lines changed

4 files changed

+42
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 68a82e44684a25314ded58349815bf6d1bc3c74a
2+
refs/heads/master: 1b7f1415d629d984a7e839a269e88ca6cfb743a0

trunk/mk/snap.mk

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@ define DEF_SNAP_FOR_STAGE_H
22
# $(1) stage
33
# $(2) triple
44

5+
ifdef CFG_INSTALL_SNAP
6+
snap-stage$(1)-H-$(2): $$(HSREQ$(1)_H_$(2))
7+
$(S)src/etc/make-snapshot.py stage$(1) $(2) install
8+
else
59
snap-stage$(1)-H-$(2): $$(HSREQ$(1)_H_$(2))
610
$(S)src/etc/make-snapshot.py stage$(1) $(2)
11+
endif
712

813
endef
914

trunk/src/etc/make-snapshot.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
#!/usr/bin/env python
22

33
import snapshot, sys
4-
print(snapshot.make_snapshot(sys.argv[1], sys.argv[2]))
4+
5+
if len(sys.argv) == 2:
6+
print(snapshot.make_snapshot(sys.argv[1], sys.argv[2], ""))
7+
else:
8+
print(snapshot.make_snapshot(sys.argv[1], sys.argv[2], sys.argv[3]))

trunk/src/etc/snapshot.py

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def hash_file(x):
111111
return scrub(h.hexdigest())
112112

113113

114-
def make_snapshot(stage, triple):
114+
def make_snapshot(stage, triple, flag):
115115
kernel = get_kernel(triple)
116116
platform = get_platform(triple)
117117
rev = local_rev_short_sha()
@@ -132,4 +132,34 @@ def make_snapshot(stage, triple):
132132
file1 = full_snapshot_name(date, rev, platform, h)
133133

134134
shutil.move(file0, file1)
135+
136+
if flag == "install":
137+
# FIXME this is an ugly quick hack; pls make it better
138+
path = file1
139+
comps = path.split("-")
140+
parts = { 'year': comps[2], \
141+
'month': comps[3], \
142+
'date': comps[4], \
143+
'check': comps[5], \
144+
'plat': comps[6], \
145+
'arch': comps[7], \
146+
'sha': comps[8].split(".")[0] }
147+
148+
shutil.move(path, "dl/" + path)
149+
shutil.move('src/snapshots.txt', 'src/snapshots-old.txt')
150+
151+
newf = open('src/snapshots.txt', 'w')
152+
newf.write("T %(year)s-%(month)s-%(date)s %(check)s\n" % parts)
153+
newf.write(" %(plat)s-%(arch)s %(sha)s\n\n" % parts)
154+
155+
oldf = open('src/snapshots-old.txt', 'r')
156+
for line in oldf:
157+
newf.write(line)
158+
oldf.close()
159+
160+
newf.close()
161+
162+
os.remove('src/snapshots-old.txt')
163+
164+
135165
return file1

0 commit comments

Comments
 (0)