[Yum-devel] [PATCH 2/2] Stops yumdownloader from attempting to download the same package twice if it is available in multiple repos. BZ 711767

Nick Jacek njacek at redhat.com
Thu Jun 9 20:52:54 UTC 2011


---
 yumdownloader.py |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/yumdownloader.py b/yumdownloader.py
index b5fb38a..e6107d4 100755
--- a/yumdownloader.py
+++ b/yumdownloader.py
@@ -171,7 +171,7 @@ class YumDownloader(YumUtilBase):
 
             pos = self.pkgSack.returnPackages(patterns=pkgnames)
             exactmatch, matched, unmatched = parsePackages(pos, pkgnames)
-            installable = yum.misc.unique(exactmatch + matched)
+            installable = (exactmatch + matched)
             if not installable:
                 try:
                     installable = self.returnPackagesByDep(pkg)
@@ -221,7 +221,12 @@ class YumDownloader(YumUtilBase):
         for pkg in toDownload:
             n,a,e,v,r = pkg.pkgtup
             packages =  self.pkgSack.searchNevra(n,e,v,r,a)
+            packages.sort()
+            last = None
             for download in packages:
+                if download.pkgtup == last :
+                    continue
+                last = download.pkgtup
                 repo = self.repos.getRepo(download.repoid)
                 remote = download.returnSimple('relativepath')
                 if opts.urls:
-- 
1.7.5.2



More information about the Yum-devel mailing list