summaryrefslogtreecommitdiff
path: root/buildtools/wafsamba
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-12-03 03:10:27 +0100
committerJelmer Vernooij <jelmer@samba.org>2010-12-03 04:24:53 +0100
commit8dcd4cca4eb81eb41fab8da7bb5f32c3a3de8b55 (patch)
tree2dd3c80dae8c66c9f1006062202f0551c6536265 /buildtools/wafsamba
parentceb1e176aa7c067e31ad596a11f67ae94a992876 (diff)
downloadsamba-8dcd4cca4eb81eb41fab8da7bb5f32c3a3de8b55.tar.gz
samba-8dcd4cca4eb81eb41fab8da7bb5f32c3a3de8b55.tar.bz2
samba-8dcd4cca4eb81eb41fab8da7bb5f32c3a3de8b55.zip
wafsamba: Override GIT_DIR without using putenv.
putenv has sideffects on later code. This overrides GIT_DIR for just this call. Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Fri Dec 3 04:24:53 CET 2010 on sn-devel-104
Diffstat (limited to 'buildtools/wafsamba')
-rw-r--r--buildtools/wafsamba/samba_version.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/buildtools/wafsamba/samba_version.py b/buildtools/wafsamba/samba_version.py
index 076615b6c4..4f99b2c087 100644
--- a/buildtools/wafsamba/samba_version.py
+++ b/buildtools/wafsamba/samba_version.py
@@ -49,9 +49,10 @@ def git_version_summary(path, env=None):
if not 'GIT' in env:
return ("GIT-UNKNOWN", {})
- os.putenv('GIT_DIR', '%s/.git' % path)
- os.putenv('GIT_WORK_TREE', path)
- git = Utils.cmd_output(env.GIT + ' show --pretty=format:"%h%n%ct%n%H%n%cd" --stat HEAD', silent=True)
+ environ = dict(os.environ)
+ environ["GIT_DIR"] = '%s/.git' % path
+ environ["GIT_WORK_TREE"] = path
+ git = Utils.cmd_output(env.GIT + ' show --pretty=format:"%h%n%ct%n%H%n%cd" --stat HEAD', silent=True, env=environ)
lines = git.splitlines()
if not lines or len(lines) < 4: