From 28412ffc8fab5c457d9d056e684f76964ef90d17 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Fri, 3 Apr 2009 15:53:54 -0400 Subject: [PATCH] Resolve package build dependencies. Since each package we add for build dependencies may add a new source rpm to our list, this needs to recurse. Signed-off-by: Bill Nottingham --- src/pypungi/__init__.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/pypungi/__init__.py b/src/pypungi/__init__.py index b0fa9689..d15bbf87 100644 --- a/src/pypungi/__init__.py +++ b/src/pypungi/__init__.py @@ -449,6 +449,29 @@ class Pungi(pypungi.PungiBase): self.logger.info("Adding source package %s.%s" % (srpmpo.name, srpmpo.arch)) self.srpmpolist.append(srpmpo) + def resolvePackageBuildDeps(self): + """Make the package lists self hosting. Requires yum + still configured, a list of package objects, and a + a list of source rpms.""" + for srpm in self.srpmpolist: + self.ayum.tsInfo.addInstall(srpm) + deppass = 1 + checked_srpms = [] + while 1: + self.logger.info("Resolving build dependencies, pass %d" % (deppass)) + prev = list(self.ayum.tsInfo.getMembers()) + for srpm in self.srpmpolist[len(checked_srpms):]: + self.getPackageDeps(srpm) + for txmbr in self.ayum.tsInfo: + if txmbr.po.arch != 'src' and txmbr.po not in self.polist: + self.polist.append(txmbr.po) + # Now that we've resolved deps, refresh the source rpm list + checked_srpms = list(self.srpmpolist) + self.getSRPMList() + deppass = deppass + 1 + if len(prev) == len(self.ayum.tsInfo.getMembers()): + break + def getDebuginfoList(self): """Cycle through the list of package objects and find debuginfo rpms for them. Requires yum still