summaryrefslogtreecommitdiffstats
path: root/openstack
diff options
context:
space:
mode:
authorDan Prince <dprince@redhat.com>2012-07-13 09:49:00 -0400
committerDan Prince <dprince@redhat.com>2012-07-13 11:00:15 -0400
commit1fc2abc1726e4e233b4ff5fb9dff415acd8b9a4b (patch)
treee8ae44c444c317a848290f2c8dbedab3a32a94d0 /openstack
parentc80bfb563626200f7587c7ca52433c59a303b469 (diff)
downloadoslo-1fc2abc1726e4e233b4ff5fb9dff415acd8b9a4b.tar.gz
oslo-1fc2abc1726e4e233b4ff5fb9dff415acd8b9a4b.tar.xz
oslo-1fc2abc1726e4e233b4ff5fb9dff415acd8b9a4b.zip
Add SKIP_GENERATE_AUTHORS option to setup.py
Updates the generate_authors function in setup.py so that it will skip generation of the authors file if the SKIP_GENERATE_AUTHORS env variable is set. Authors doesn't currently take that long to generate but having the option to explicitly skip it (regardless of whether .git is there) seems like a good addition. Change-Id: Ie18064d2450cecc86f18d0b10e1ce473253d1a51
Diffstat (limited to 'openstack')
-rw-r--r--openstack/common/setup.py26
1 files changed, 15 insertions, 11 deletions
diff --git a/openstack/common/setup.py b/openstack/common/setup.py
index 2be72e6..cd4b97b 100644
--- a/openstack/common/setup.py
+++ b/openstack/common/setup.py
@@ -191,17 +191,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