Add a function to get debuginfo packages to match the other packages we've gathered.

This has a couple hardcoded special cases for kernel and glibc for the -common debuginfo
Try to match the original po as close as possible.
This commit is contained in:
Jesse Keating 2008-07-08 17:58:24 -04:00
parent cbe47772c9
commit 26795667ac

View File

@ -127,6 +127,7 @@ class Pungi(pypungi.PungiBase):
self.ksparser = ksparser
self.polist = []
self.srpmlist = []
self.debuginfolist = []
self.resolved_deps = {} # list the deps we've already resolved, short circuit.
self.repos = []
self.mirrorlists = []
@ -378,6 +379,47 @@ class Pungi(pypungi.PungiBase):
if not srpm in self.srpmlist:
self.srpmlist.append(srpm)
def getDebuginfoList(self):
"""Cycle through the list of package objects and find
debuginfo rpms for them. Requires yum still
configured and a list of package objects"""
for po in self.polist:
debugname = '%s-debuginfo' % po.name
results = self.ayum.pkgSack.searchNevra(name=debugname,
epoch=po.epoch,
ver=po.version,
rel=po.release,
arch=po.arch)
if results:
if not results[0] in self.debuginfolist:
self.logger.debug('Added %s found by name' % results[0].name)
self.debuginfolist.append(results[0])
else:
srpm = po.sourcerpm.split('.src.rpm')[0]
sname, sver, srel = srpm.rsplit('-', 2)
debugname = '%s-debuginfo' % sname
srcresults = self.ayum.pkgSack.searchNevra(name=debugname,
ver=sver,
rel=srel,
arch=po.arch)
if srcresults:
if not srcresults[0] in self.debuginfolist:
self.logger.debug('Added %s found by srpm' % srcresults[0].name)
self.debuginfolist.append(srcresults[0])
if po.name == 'kernel' or po.name == 'glibc':
debugcommon = '%s-debuginfo-common' % po.name
commonresults = self.ayum.pkgSack.searchNevra(name=debugcommon,
epoch=po.epoch,
ver=po.version,
rel=po.release,
arch=po.arch)
if commonresults:
if not commonresults[0] in self.debuginfolist:
self.logger.debug('Added %s found by common' % commonresults[0].name)
self.debuginfolist.append(commonresults[0])
def _downloadPackageList(self, polist, relpkgdir):
"""Cycle through the list of package objects and
download them from their respective repos."""