aboutsummaryrefslogtreecommitdiff
path: root/src/etc/make-snapshot.py
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2011-05-02 18:56:13 -0700
committerGraydon Hoare <[email protected]>2011-05-02 18:56:13 -0700
commitcb53065a2116067a036993a6762259a66c4abfac (patch)
treec23b9e81c56fc770a8a16637d4ff81e645b6e244 /src/etc/make-snapshot.py
parentRevert "Use check instead of assert in export-unexported-dep" (diff)
downloadrust-cb53065a2116067a036993a6762259a66c4abfac.tar.xz
rust-cb53065a2116067a036993a6762259a66c4abfac.zip
Initial sketch of snapshot support code, based on code from marijn.
Diffstat (limited to 'src/etc/make-snapshot.py')
-rwxr-xr-xsrc/etc/make-snapshot.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/etc/make-snapshot.py b/src/etc/make-snapshot.py
new file mode 100755
index 00000000..3d6c48e3
--- /dev/null
+++ b/src/etc/make-snapshot.py
@@ -0,0 +1,24 @@
+#!/usr/bin/env python
+
+import shutil, tarfile
+from snapshot import *
+
+kernel = get_kernel()
+cpu = get_cpu()
+rev = local_rev_short_sha()
+date = local_rev_committer_date().split()[0]
+
+file0 = partial_snapshot_name(date, rev, kernel, cpu)
+
+tar = tarfile.open(file0, "w:bz2")
+for name in snapshot_files[kernel]:
+ tar.add(os.path.join("stage2", name),
+ os.path.join("rust-stage0", name))
+tar.close()
+
+h = hash_file(file0)
+file1 = full_snapshot_name(date, rev, kernel, cpu, h)
+
+shutil.move(file0, file1)
+
+print file1