extras-buildsys/utils/pushscript WhatsNew.py,1.11,1.12

Michael Schwendt mschwendt at fedoraproject.org
Sat Aug 1 08:56:48 UTC 2009


Author: mschwendt

Update of /cvs/fedora/extras-buildsys/utils/pushscript
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv17809

Modified Files:
	WhatsNew.py 
Log Message:
Inherit external release repos, if defined in oldpackagedirs map, when (re-)initialising whatsnew db.


Index: WhatsNew.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/utils/pushscript/WhatsNew.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- WhatsNew.py	6 Nov 2008 12:20:32 -0000	1.11
+++ WhatsNew.py	1 Aug 2009 08:56:46 -0000	1.12
@@ -75,18 +75,19 @@
             rpmfiles.remove(f)
 
 
-def rebuild(dist,srcdir):
+def rebuild(dist,srcdirs):
     """initialise the pickle files"""
     ts = rpmUtils.transaction.initReadOnlyTransaction()
 
     rpmfiles = []
-    for root, dirs, files in os.walk(srcdir):
-        srpms = []
-        srpms.extend(fnmatch.filter(files,'*.src.rpm'))
-        srpms.extend(fnmatch.filter(files,'*.nosrc.rpm'))
-        for f in srpms:
-            srcfile = os.path.join(root,f)
-            rpmfiles.append(srcfile)
+    for srcdir in srcdirs:
+        for root, dirs, files in os.walk(srcdir):
+            srpms = []
+            srpms.extend(fnmatch.filter(files,'*.src.rpm'))
+            srpms.extend(fnmatch.filter(files,'*.nosrc.rpm'))
+            for f in srpms:
+                srcfile = os.path.join(root,f)
+                rpmfiles.append(srcfile)
 
     stripold(rpmfiles)
     for srcfile in rpmfiles:
@@ -255,9 +256,24 @@
     names = {}
     clogdiffs = {}
     for dist in cfg.alldists:
-        srcdir = Utils.srpm_repodir( cfg, dist )
-        print '[WhatsNew] Rebuilding from', srcdir
-        rebuild(dist,srcdir)
+        srcdirs = [Utils.srpm_repodir( cfg, dist )]
+
+        # Consider the oldpackagedirs map to inherit src.rpms from
+        # any external release repos.
+        # It is assumed that 
+        if hasattr(cfg,'oldpackagedirs'):
+            dirs = cfg.oldpackagedirs.get(dist,None)
+            if not dirs or not isinstance(dirs,list):
+                dirs = []
+            for dir in dirs:
+                srcdir = dir.replace('$arch','source/SRPMS')
+                if os.path.exists( srcdir ):
+                    srcdirs.append( srcdir )
+                else:
+                    print 'WARNING:', srcdir, 'does not exist!'
+
+        print '[WhatsNew] Rebuilding from', srcdirs
+        rebuild(dist,srcdirs)
     save(cfg.rundir)
 
 




More information about the fedora-extras-commits mailing list