Speed up install "font(:lang=en)", by a huge amount (~21 minutes)
authorJames Antill <james@and.org>
Fri, 19 Jun 2009 19:24:05 +0000 (15:24 -0400)
committerJames Antill <james@and.org>
Fri, 19 Jun 2009 19:24:05 +0000 (15:24 -0400)
yum/depsolve.py

index 81de803..d2bd7ad 100644 (file)
@@ -1106,6 +1106,7 @@ class Depsolve(object):
         # add the negative of the length of the name to the score
         
         
+        lpos = {}
         for po in pkgs:
             for nextpo in pkgs:
                 if po == nextpo:
@@ -1115,8 +1116,9 @@ class Depsolve(object):
                 # treat it like it's obsoleted. The problem here is X-1
                 # accidentally provides FOO, so you release X-2 without the
                 # provide, but X-1 is still picked over a real provider.
-                lpos = self.pkgSack.returnNewestByName(po.name)
-                if not lpos or po != sorted(lpos)[-1]:
+                if po.name not in lpos:
+                    lpos[po.name] = self.pkgSack.returnNewestByName(po.name)[:1]
+                if not lpos[po.name] or not po.verEQ(lpos[po.name][0]):
                     pkgresults[po] -= 1024
 
                 obsoleted = False