Add support for globbing in manifest

Redo how we find packages making use of a better yum call
Add warning output for unmatched packages in the manifest
This commit is contained in:
jkeating@reducto.boston.redhat.com 2007-02-08 20:25:41 -05:00 committed by Jesse Keating
parent 5749bcd8da
commit 8b1b9b36eb
2 changed files with 16 additions and 7 deletions

View File

@ -1,6 +1,10 @@
* Thu Feb 08 2007 Jesse Keating <jkeating@redhat.com>
- Add support for globbing in manifest
* Tue Feb 06 2007 Jesse Keating <jkeating@redhat.com>
- yum bestPackagesFromList takes an arch argument. Fixes ppc64 bug
- Don't use 'returnSimple' anymore, deprecated in yum api
- Speed up depsolving a bit by tracking solved deps
* Sat Feb 03 2007 Jesse Keating <jkeating@redhat.com>
- Be able to opt-out of a bugurl since buildinstall supports this

View File

@ -112,18 +112,23 @@ class Gather(yum.YumBase):
unprocessed_pkgs = {} # list of packages yet to depsolve ## Use dicts for speed
final_pkgobjs = {} # The final list of package objects
for pkg in self.pkglist: # cycle through our package list and get repo matches
matches = self.pkgSack.searchNevra(name=pkg)
mysack = yum.packageSack.ListPackageSack(matches)
for match in mysack.returnNewestByNameArch():
unprocessed_pkgs[match] = None
self.tsInfo.addInstall(match)
# Search repos for things in our manifest, supports globs
(exactmatched, matched, unmatched) = yum.packages.parsePackages(self.pkgSack.returnPackages(), self.pkglist, casematch=1)
matches = exactmatched + matched
# Get the newest results from the search
mysack = yum.packageSack.ListPackageSack(matches)
for match in mysack.returnNewestByNameArch():
unprocessed_pkgs[match] = None
self.tsInfo.addInstall(match)
if not self.config.has_option('default', 'quiet'):
for pkg in unprocessed_pkgs.keys():
self.logger.info('Found %s.%s' % (pkg.name, pkg.arch))
for pkg in unmatched:
self.logger.warn('Could not find a match for %s' % pkg)
if len(unprocessed_pkgs) == 0:
raise yum.Errors.MiscError, 'No packages found to download.'