summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorChuck Ebbert <cebbert@redhat.com>2011-11-29 05:45:06 -0500
committerChuck Ebbert <cebbert@redhat.com>2011-11-29 05:45:06 -0500
commit5ae7978615199a33fb3864a93e89efe8910ae3ab (patch)
tree79f6763163d04f5b8ba374b4c0c5289fda36fb0f /scripts
parent9af210dc917e8f01ce9666366fd42f88e37a159c (diff)
downloadkernel-5ae7978615199a33fb3864a93e89efe8910ae3ab.tar.gz
kernel-5ae7978615199a33fb3864a93e89efe8910ae3ab.tar.xz
kernel-5ae7978615199a33fb3864a93e89efe8910ae3ab.zip
bumpspecfile: get user name and email from git config
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/bumpspecfile.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/scripts/bumpspecfile.py b/scripts/bumpspecfile.py
index 478e82871..bc02ab300 100755
--- a/scripts/bumpspecfile.py
+++ b/scripts/bumpspecfile.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
#
-# Needs $GIT_COMMITTER_NAME and $GIT_COMMITTER_EMAIL set.
+# Uses git config options user.name and user.email, falls
+# back to env vars $GIT_COMMITTER_NAME and $GIT_COMMITTER_EMAIL
#
import re
import sys
@@ -44,8 +45,12 @@ class Specfile:
self.vr = " "+ver+'-'+nextrel
def addChangelogEntry(self,entry):
- user = os.environ.get("GIT_COMMITTER_NAME","unknown")
- email = os.environ.get("GIT_COMMITTER_EMAIL","unknown")
+ user = os.popen("git config --get user.name").read().rstrip()
+ if (user == ""):
+ user = os.environ.get("GIT_COMMITTER_NAME","Unknown")
+ email = os.popen("git config --get user.email").read().rstrip()
+ if (email == ""):
+ email = os.environ.get("GIT_COMMITTER_EMAIL","unknown")
if (email == "unknown"):
email = os.environ.get("USER","unknown")+"@fedoraproject.org"
changematch=re.compile(r"^%changelog")