]> git.lizzy.rs Git - rust.git/blob - src/etc/make-snapshot.py
More hacking on the snapshot system.
[rust.git] / src / etc / make-snapshot.py
1 #!/usr/bin/env python
2
3 import shutil, tarfile
4 from snapshot import *
5
6 kernel = get_kernel()
7 cpu = get_cpu()
8 rev = local_rev_short_sha()
9 date = local_rev_committer_date().split()[0]
10
11 file0 = partial_snapshot_name(date, rev, kernel, cpu)
12
13 tar = tarfile.open(file0, "w:bz2")
14 for name in snapshot_files[kernel]:
15     tar.add(os.path.join("stage2", name),
16             os.path.join("rust-stage0", name))
17 tar.close()
18
19 h = hash_file(file0)
20 file1 = full_snapshot_name(date, rev, kernel, cpu, h)
21
22 shutil.move(file0, file1)
23
24 print(file1)