rpms/kernel/devel/scripts bumpspecfile.py,1.2,1.3

Dave Jones (davej) fedora-extras-commits at redhat.com
Thu Dec 13 20:42:53 UTC 2007


Author: davej

Update of /cvs/pkgs/rpms/kernel/devel/scripts
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv11134/scripts

Modified Files:
	bumpspecfile.py 
Log Message:
make scripts/bumpspecfile.py determine the username/email to add changelog entry as


Index: bumpspecfile.py
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/scripts/bumpspecfile.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- bumpspecfile.py	15 Oct 2007 21:39:17 -0000	1.2
+++ bumpspecfile.py	13 Dec 2007 20:42:04 -0000	1.3
@@ -1,6 +1,6 @@
 #!/usr/bin/python
 #
-# FIXME: Remove hardcoded name/email.
+# Needs $GIT_COMMITTER_NAME and $GIT_COMMITTER_EMAIL set.
 #
 import re
 import sys
@@ -13,10 +13,14 @@
         file=open(filename,"r")
         self.lines=file.readlines()
 
-    def addChangelogEntry(self,entry,email):
+    def addChangelogEntry(self,entry):
+        user = os.environ.get("GIT_COMMITTER_NAME","unknown")
+        email = os.environ.get("GIT_COMMITTER_EMAIL","unknown")
+        if (email == "unknown"):
+            email = os.environ.get("USER","unknown")+"fedoraproject.org"
         changematch=re.compile(r"^%changelog")
         date=time.strftime("%a %b %d %Y",   time.localtime(time.time()))
-        newchangelogentry="%changelog\n* "+date+" "+email+"\n"+entry+"\n\n"
+        newchangelogentry="%changelog\n* "+date+" "+user+" <"+email+">"+"\n"+entry+"\n\n"
         for i in range(len(self.lines)):
             if(changematch.match(self.lines[i])):
                 self.lines[i]=newchangelogentry
@@ -31,6 +35,6 @@
   aspec=(sys.argv[1])
   s=Specfile(aspec)
   entry=(sys.argv[2])
-  s.addChangelogEntry(entry,"Dave Jones <davej at redhat.com>")
+  s.addChangelogEntry(entry)
   s.writeFile(aspec)
 




More information about the fedora-extras-commits mailing list