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
|
#!/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 re
|
||||||
import sys
|
import sys
|
||||||
@ -44,7 +45,11 @@ class Specfile:
|
|||||||
self.vr = " "+ver+'-'+nextrel
|
self.vr = " "+ver+'-'+nextrel
|
||||||
|
|
||||||
def addChangelogEntry(self,entry):
|
def addChangelogEntry(self,entry):
|
||||||
user = os.environ.get("GIT_COMMITTER_NAME","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")
|
email = os.environ.get("GIT_COMMITTER_EMAIL","unknown")
|
||||||
if (email == "unknown"):
|
if (email == "unknown"):
|
||||||
email = os.environ.get("USER","unknown")+"@fedoraproject.org"
|
email = os.environ.get("USER","unknown")+"@fedoraproject.org"
|
||||||
|
Loading…
Reference in New Issue
Block a user