aboutsummaryrefslogtreecommitdiff
path: root/src/etc
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2011-05-03 09:25:59 -0700
committerGraydon Hoare <[email protected]>2011-05-03 09:25:59 -0700
commit54bfe8ee27b2a2958fec5e9713690a4336d8b4e4 (patch)
treeacf39329cb4a686670048f01f8e6639d44ea6ac9 /src/etc
parentRemove unused variable. (diff)
downloadrust-54bfe8ee27b2a2958fec5e9713690a4336d8b4e4.tar.xz
rust-54bfe8ee27b2a2958fec5e9713690a4336d8b4e4.zip
Small fixes to snapshot script.
Diffstat (limited to 'src/etc')
-rw-r--r--src/etc/snapshot.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/etc/snapshot.py b/src/etc/snapshot.py
index 28f94290..7dd963e8 100644
--- a/src/etc/snapshot.py
+++ b/src/etc/snapshot.py
@@ -1,6 +1,12 @@
import re, os, sys, hashlib, tarfile, shutil, subprocess, tempfile
-src_dir = os.getenv("CFG_SRC_DIR")
+def scrub(b):
+ if sys.version_info >= (3,) and type(b) == bytes:
+ return b.decode('ascii')
+ else:
+ return b
+
+src_dir = scrub(os.getenv("CFG_SRC_DIR"))
if not src_dir:
raise Exception("missing env var CFG_SRC_DIR")
@@ -63,11 +69,6 @@ def get_cpu():
def get_platform():
return "%s-%s" % (get_kernel(), get_cpu())
-def scrub(b):
- if sys.version_info >= (3,) and type(b) == bytes:
- return b.decode('ascii')
- else:
- return b
def cmd_out(cmdline):
p = subprocess.Popen(cmdline,
@@ -76,7 +77,8 @@ def cmd_out(cmdline):
def local_rev_info(field):
- return cmd_out(["git", "log", "-n", "1",
+ return cmd_out(["git", "--git-dir=" + os.path.join(src_dir, ".git"),
+ "log", "-n", "1",
"--format=%%%s" % field, "HEAD"])
@@ -110,8 +112,8 @@ def make_snapshot():
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.add(os.path.join("stage2", name),
+ os.path.join("rust-stage0", name))
tar.close()
h = hash_file(file0)