[PATCH] Add a method that completes the package set with all subpackages of currently used source rpms.

Bill Nottingham notting at redhat.com
Tue Jan 6 21:35:50 UTC 2009


In other places, this method could be called No Package Left Behind.
---
 src/pypungi/__init__.py |   26 ++++++++++++++++++++++++++
 1 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/src/pypungi/__init__.py b/src/pypungi/__init__.py
index 1d2734c..01d7b90 100644
--- a/src/pypungi/__init__.py
+++ b/src/pypungi/__init__.py
@@ -461,6 +461,32 @@ class Pungi(pypungi.PungiBase):
             if len(prev) == len(self.ayum.tsInfo.getMembers()):
                 break
 
+    def completePackageSet(self):
+        """Cycle through all package objects, and add any
+           that correspond to a source rpm that we are including.
+           Requires yum still configured and a list of package
+           objects."""
+        thepass = 1
+        while 1:
+            prevlen = len(self.srpmpolist)
+            self.logger.info("Completing package set, pass %d" % (thepass,))
+            for srpm in self.srpmpolist[len(self.srpms_fulltree):]:
+                for po in self.bin_by_src[srpm]:
+                    if po not in self.polist:
+                        self.logger.info("Adding %s.%s to complete package set" % (po.name, po.arch))
+                        self.polist.append(po)
+                        self.getPackageDeps(po)
+            for txmbr in self.ayum.tsInfo:
+                if txmbr.po.arch != 'src' and txmbr.po not in self.polist:
+                    self.polist.append(txmbr.po)
+            self.srpms_fulltree = list(self.srpmpolist)
+            # Now that we've resolved deps, refresh the source rpm list
+            self.getSRPMList()
+            if len(self.srpmpolist) == prevlen:
+                self.logger.info("Completion finished in %d passes" % (thepass,))
+                break
+            thepass = thepass + 1
+
     def getDebuginfoList(self):
         """Cycle through the list of package objects and find
            debuginfo rpms for them.  Requires yum still
-- 
1.6.0.6




More information about the Fedora-buildsys-list mailing list