Permalink
Browse files

Snippet 2 support for multiple versions

  • Loading branch information...
1 parent e151d6a commit 6de4df97a275f7857ad1f7991e3bcf8f36b23bd6 @tom111 committed Feb 11, 2012
Showing with 7 additions and 5 deletions.
  1. +7 −5 tatt/scriptwriter.py
View
@@ -143,6 +143,8 @@ def writecommitscript (job, config):
packageHash[pack.packageCatName()] = packageHash[pack.packageCatName()] + [pack]
else:
packageHash[pack.packageCatName()] = [pack]
+ # Prepare a list of ebuild names strings
+ ebuilds = [p.packageName()+"-"+p.packageVersion()+".ebuild" for p in packageHash[pack]]
# First round (ekeyword)
for pack in packageHash.keys():
s = csnippet.replace("@@BUG@@", job.bugnumber)
@@ -155,17 +157,17 @@ def writecommitscript (job, config):
print "No job type? Can't continue. This is a bug"
exit(1)
s = s.replace("@@NEWKEYWORD@@", newkeyword)
- ebuilds = [p.packageName()+"-"+p.packageVersion()+".ebuild" for p in packageHash[pack]]
s = s.replace("@@EBUILD@@", " ".join(ebuilds))
s = s.replace("@@CP@@", pack)
outfile.write(s)
- # Second round (repoman -d full checks)
- for pack in job.packageList:
+ # Second round: repoman -d full checks and commit, should be done once per
+ # key of packageHash
+ for packCN in packageHash.keys():
s = csnippet2.replace("@@BUG@@", job.bugnumber)
s = s.replace("@@ARCH@@", config['arch'])
s = s.replace("@@NEWKEYWORD@@", newkeyword)
- s = s.replace("@@EBUILD@@", pack.packageName()+"-"+pack.packageVersion()+".ebuild")
- s = s.replace("@@CP@@", pack.packageCatName())
+ s = s.replace("@@EBUILD@@", " ".join(ebuilds))
+ s = s.replace("@@CP@@", packCN)
outfile.write(s)
# Footer (committing)
outfile.write (commitfooterfile.read().replace("@@ARCH@@", config['arch']).replace("@@BUG@@", job.bugnumber))

0 comments on commit 6de4df9

Please sign in to comment.