rpms/kernel/devel/scripts bumpspecfile.py, NONE, 1.1 newpatch.sh, 1.1, 1.2
Dave Jones (davej)
fedora-extras-commits at redhat.com
Mon Oct 15 21:07:11 UTC 2007
Author: davej
Update of /cvs/pkgs/rpms/kernel/devel/scripts
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv22384/scripts
Modified Files:
newpatch.sh
Added Files:
bumpspecfile.py
Log Message:
add bumpspecfile.py
--- NEW FILE bumpspecfile.py ---
#!/usr/bin/python
import re
import sys
import time
import os
import string
class Specfile:
def __init__(self,filename):
file=open(filename,"r")
self.lines=file.readlines()
def addChangelogEntry(self,entry,email):
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"
for i in range(len(self.lines)):
if(changematch.match(self.lines[i])):
self.lines[i]=newchangelogentry
break
def writeFile(self,filename):
file=open(filename,"w")
file.writelines(self.lines)
file.close()
if __name__=="__main__":
aspec=(sys.argv[1])
s=Specfile(aspec)
entry=(sys.argv[2])
s.addChangelogEntry(entry,"Dave Jones <davej at redhat.com>")
s.writeFile(aspec)
Index: newpatch.sh
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/scripts/newpatch.sh,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- newpatch.sh 9 Oct 2007 05:17:30 -0000 1.1
+++ newpatch.sh 15 Oct 2007 21:06:34 -0000 1.2
@@ -16,6 +16,6 @@
cvs add $1
-bumpspecfile.py kernel.spec "- $2"
+scripts/bumpspecfile.py kernel.spec "- $2"
make clog
More information about the fedora-extras-commits
mailing list