diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2015-05-18 17:37:51 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2015-05-19 19:28:19 +0200 |
commit | 5d672b9a530e79aff2a7791df82893bcd50d6233 (patch) | |
tree | e6f7622548b16db6783568922a29c748fa8d0cbe /buildtools/wafsamba/samba_version.py | |
parent | 8eda4efacdeca4c6b8da8bd9e924af2f08db7f89 (diff) | |
download | samba-5d672b9a530e79aff2a7791df82893bcd50d6233.tar.gz |
Factor out function for finding Git binary.
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'buildtools/wafsamba/samba_version.py')
-rw-r--r-- | buildtools/wafsamba/samba_version.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/buildtools/wafsamba/samba_version.py b/buildtools/wafsamba/samba_version.py index 1f5be49033d..bb0be96f869 100644 --- a/buildtools/wafsamba/samba_version.py +++ b/buildtools/wafsamba/samba_version.py @@ -1,17 +1,16 @@ import os import Utils import samba_utils -import sys +from samba_git import find_git def git_version_summary(path, env=None): - # Get version from GIT - if not 'GIT' in env and os.path.exists("/usr/bin/git"): - # this is useful when doing make dist without configuring - env.GIT = "/usr/bin/git" + git = find_git(env) - if not 'GIT' in env: + if git is None: return ("GIT-UNKNOWN", {}) + env.GIT = git + environ = dict(os.environ) environ["GIT_DIR"] = '%s/.git' % path environ["GIT_WORK_TREE"] = path |