From 8b1b9b36eb61f009cf51b5b7f982e0b5e97fa2af Mon Sep 17 00:00:00 2001 From: "jkeating@reducto.boston.redhat.com" <> Date: Thu, 8 Feb 2007 20:25:41 -0500 Subject: [PATCH] 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 --- Changelog | 4 ++++ pypungi/gather.py | 19 ++++++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/Changelog b/Changelog index 6bb0fde1..3b6e1d43 100644 --- a/Changelog +++ b/Changelog @@ -1,6 +1,10 @@ +* Thu Feb 08 2007 Jesse Keating +- Add support for globbing in manifest + * Tue Feb 06 2007 Jesse Keating - 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 - Be able to opt-out of a bugurl since buildinstall supports this diff --git a/pypungi/gather.py b/pypungi/gather.py index bd5ef279..2d1c0dce 100755 --- a/pypungi/gather.py +++ b/pypungi/gather.py @@ -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.'