diff options
author | Jenkins <jenkins@review.openstack.org> | 2012-07-13 15:13:44 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2012-07-13 15:13:44 +0000 |
commit | c8ea903532b6f39915ccbc9b911f461e16a1cddc (patch) | |
tree | 34242655429de69bf19a3ba68e5d81ab30d25049 /setup.py | |
parent | 621ee29407c64dc2cfc40ceda97b58a9fd859a5b (diff) | |
parent | 356145981b7f9ca08d850f97deb2bd23a91340bd (diff) | |
download | pbr-c8ea903532b6f39915ccbc9b911f461e16a1cddc.tar.gz |
Merge "Add SKIP_GENERATE_AUTHORS option to setup.py"
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 26 |
1 files changed, 15 insertions, 11 deletions
@@ -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 |