bumpspecfile: get user name and email from git config
This commit is contained in:
parent
9af210dc91
commit
5ae7978615
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user