summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-07-13 15:13:44 +0000
committerGerrit Code Review <review@openstack.org>2012-07-13 15:13:44 +0000
commitc8ea903532b6f39915ccbc9b911f461e16a1cddc (patch)
tree34242655429de69bf19a3ba68e5d81ab30d25049 /setup.py
parent621ee29407c64dc2cfc40ceda97b58a9fd859a5b (diff)
parent356145981b7f9ca08d850f97deb2bd23a91340bd (diff)
downloadpbr-c8ea903532b6f39915ccbc9b911f461e16a1cddc.tar.gz
Merge "Add SKIP_GENERATE_AUTHORS option to setup.py"
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py26
1 files changed, 15 insertions, 11 deletions
diff --git a/setup.py b/setup.py
index 48601ea..59f255d 100644
--- a/setup.py
+++ b/setup.py
@@ -195,17 +195,21 @@ def generate_authors():
jenkins_email = 'jenkins@review.openstack.org'
old_authors = 'AUTHORS.in'
new_authors = 'AUTHORS'
- if os.path.isdir('.git'):
- # don't include jenkins email address in AUTHORS file
- git_log_cmd = ("git log --format='%aN <%aE>' | sort -u | "
- "grep -v " + jenkins_email)
- changelog = _run_shell_command(git_log_cmd)
- mailmap = parse_mailmap()
- with open(new_authors, 'w') as new_authors_fh:
- new_authors_fh.write(canonicalize_emails(changelog, mailmap))
- if os.path.exists(old_authors):
- with open(old_authors, "r") as old_authors_fh:
- new_authors_fh.write('\n' + old_authors_fh.read())
+ if not os.getenv('SKIP_GENERATE_AUTHORS'):
+ if os.path.isdir('.git'):
+ # don't include jenkins email address in AUTHORS file
+ git_log_cmd = ("git log --format='%aN <%aE>' | sort -u | "
+ "grep -v " + jenkins_email)
+ changelog = _run_shell_command(git_log_cmd)
+ mailmap = parse_mailmap()
+ with open(new_authors, 'w') as new_authors_fh:
+ new_authors_fh.write(canonicalize_emails(changelog, mailmap))
+ if os.path.exists(old_authors):
+ with open(old_authors, "r") as old_authors_fh:
+ new_authors_fh.write('\n' + old_authors_fh.read())
+ else:
+ open(new_authors, 'w').close()
+
_rst_template = """%(heading)s
%(underline)s