summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikhil Manchanda <SlickNik@gmail.com>2013-10-30 03:08:48 -0700
committerNikhil Manchanda <SlickNik@gmail.com>2013-10-30 03:12:34 -0700
commit629bbce1c88a4a576182c7a41372a70a864d8226 (patch)
tree647039426873b8a093cb84a866fa3f49c7f4b13d
parente8a3c7e7ba4430870849ff34ab3437db2ed1f942 (diff)
downloadpbr-629bbce1c88a4a576182c7a41372a70a864d8226.tar.gz
Fixed pbr install to not error out and fail if git is not installed0.5.23
Fixed the issue where pbr was erroring out (file not found) when running 'python setup.py egg_info' since it was trying to get the .git directory even if git was not installed. Closes bug 1245676 Change-Id: I31e1f86f10f18897774b49eb293aede31641db31
-rw-r--r--pbr/packaging.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/pbr/packaging.py b/pbr/packaging.py
index f4e338c..204ca9c 100644
--- a/pbr/packaging.py
+++ b/pbr/packaging.py
@@ -225,6 +225,10 @@ def _get_git_directory():
return _run_shell_command(['git', 'rev-parse', '--git-dir'])
+def _git_is_installed():
+ return _run_shell_command(['which', 'git'])
+
+
def get_boolean_option(option_dict, option_name, env_name):
return ((option_name in option_dict
and option_dict[option_name][1].lower() in TRUE_VALUES) or
@@ -306,7 +310,7 @@ def _find_git_files(dirname='', git_dir=None):
at absurd times. We only want to do this when we are building an sdist.
"""
file_list = []
- if git_dir is None:
+ if git_dir is None and _git_is_installed():
git_dir = _get_git_directory()
if git_dir:
log.info("[pbr] In git context, generating filelist from git")