summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorRobert Myers <robert.myers@rackspace.com>2013-02-15 14:32:07 -0600
committerRobert Myers <robert.myers@rackspace.com>2013-02-15 14:32:07 -0600
commitba9731f371893ccaab60029587519ef41b58b44c (patch)
tree195b50279cd1e198498f11dbb6bfd8b88768392b /setup.py
parentad8a8de3c938069f78985ceb118fb0ce9ae074e8 (diff)
downloadpbr-ba9731f371893ccaab60029587519ef41b58b44c.tar.gz
Change the check for the existence of .git directory.
In common setup the check for the .git directory is too restrictive. Instead of checking that it is a directory just check to see if it exists. That way if the project is part of a submodule it will continue to work correctly. Change-Id: If6b6531ab5778ac17537e3f18bde1844620c8316 Fixes: bug 1126416
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/setup.py b/setup.py
index 2a971e7..22f864d 100644
--- a/setup.py
+++ b/setup.py
@@ -131,7 +131,7 @@ def write_git_changelog():
"""Write a changelog based on the git changelog."""
new_changelog = 'ChangeLog'
if not os.getenv('SKIP_WRITE_GIT_CHANGELOG'):
- if os.path.isdir('.git'):
+ if os.path.exists('.git'):
git_log_cmd = 'git log --stat'
changelog = _run_shell_command(git_log_cmd)
mailmap = parse_mailmap()
@@ -147,7 +147,7 @@ def generate_authors():
old_authors = 'AUTHORS.in'
new_authors = 'AUTHORS'
if not os.getenv('SKIP_GENERATE_AUTHORS'):
- if os.path.isdir('.git'):
+ if os.path.exists('.git'):
# don't include jenkins email address in AUTHORS file
git_log_cmd = ("git log --format='%aN <%aE>' | sort -u | "
"egrep -v '" + jenkins_email + "'")
@@ -279,7 +279,7 @@ def _get_version_from_git(pre_version):
revision if there is one, or tag plus number of additional revisions
if the current revision has no tag."""
- if os.path.isdir('.git'):
+ if os.path.exists('.git'):
if pre_version:
try:
return _run_shell_command(