mirror of
https://github.com/samba-team/samba.git
synced 2025-02-26 21:57:41 +03:00
Factor out function for finding Git binary.
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
parent
8eda4efacd
commit
5d672b9a53
14
buildtools/wafsamba/samba_git.py
Normal file
14
buildtools/wafsamba/samba_git.py
Normal file
@ -0,0 +1,14 @@
|
||||
import os
|
||||
|
||||
def find_git(env=None):
|
||||
"""Find the git binary."""
|
||||
if env is not None and 'GIT' in env:
|
||||
return env['GIT']
|
||||
|
||||
# Get version from GIT
|
||||
if os.path.exists("/usr/bin/git"):
|
||||
# this is useful when doing make dist without configuring
|
||||
return "/usr/bin/git"
|
||||
|
||||
return None
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user