From bf4931150e8de4961925fe3352d7117c7a8b76b1 Mon Sep 17 00:00:00 2001 From: "jkeating@localhost.localdomain" <> Date: Sun, 15 Oct 2006 23:03:45 -0400 Subject: [PATCH] Don't iterate through arch list to get package, search returns list more logging cleanups to add arch --- gather/gather.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gather/gather.py b/gather/gather.py index 866d6188..a3537d1c 100755 --- a/gather/gather.py +++ b/gather/gather.py @@ -71,8 +71,11 @@ class Gather(yum.YumBase): final_pkgobjs = [] # The final list of package objects for pkg in self.pkglist: # cycle through our package list and get repo matches - for arch in self.archlist: - unprocessed_pkgs.extend(self.pkgSack.searchNevra(name=pkg, arch=arch)) + unprocessed_pkgs.extend(self.pkgSack.searchNevra(name=pkg)) + + if not self.opts.quiet: + for pkg in unprocessed_pkgs: + self.logger.info('Found %s.%s' % (pkg.name, pkg.arch)) if len(unprocessed_pkgs) == 0: raise yum.Errors.MiscError, 'No packages found to download.' @@ -80,7 +83,8 @@ class Gather(yum.YumBase): while len(unprocessed_pkgs) > 0: # Our fun loop for pkg in unprocessed_pkgs: - final_pkgobjs.append(pkg) # Add the pkg to our final list + if not pkg in unprocessed_pkgs and not pkg in final_pkgobjs: + final_pkgobjs.append(pkg) # Add the pkg to our final list deplist = self.findDeps(pkg) # Get the deps of our package unprocessed_pkgs.remove(pkg) # Clear the package out of our todo list. @@ -98,7 +102,7 @@ class Gather(yum.YumBase): if not self.opts.quiet: downloads = [] for pkg in self.polist: - downloads.append(pkg.name) + downloads.append(pkg.name + pkg.arch) self.logger.info("Download list: %s" % downloads) pkgdir = os.path.join(self.opts.destdir, 'tree') # Package location within destdir, name subject to change/config