[yum-commits] package-cleanup.py

James Antill james at osuosl.org
Wed Mar 25 13:25:52 UTC 2009


 package-cleanup.py |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 8c085e4f9e719bdf569e2a82a1ebf2618f7e1d26
Author: Ville Skyttä <ville.skytta at iki.fi>
Date:   Wed Mar 25 00:21:59 2009 +0200

    Fix same arch duplicate checking.

diff --git a/package-cleanup.py b/package-cleanup.py
index 7b4646f..11d8415 100755
--- a/package-cleanup.py
+++ b/package-cleanup.py
@@ -161,15 +161,15 @@ def findDupes(my):
     for (n) in pkgdict.keys():
         # is more than one package with this name ?
         if len(pkgdict[(n)]) > 1:
-            archs = []
+            archs = set()
             for (e,v,r,a) in pkgdict[(n)]:
-                archs.append(a)
-            # If all packages with the same name has the same arch, then it is a dupe
+                archs.add(a)
+            # If all packages with the same name have the same arch, then it is a dupe
             if len(archs) == 1:
                 refined[(n)] = pkgdict[(n)]
             else:
-                a1 = archs[0]
-                for a2 in archs[1:]:
+                a1 = archs.pop()
+                for a2 in archs:
                     if isDuplicate(a1,a2):
                         refined[(n)] = pkgdict[(n)]
                             


More information about the Yum-commits mailing list