repoman: simplify ebuild sort code
authorZac Medico <zmedico@gentoo.org>
Sun, 13 May 2012 21:43:21 +0000 (14:43 -0700)
committerZac Medico <zmedico@gentoo.org>
Sun, 13 May 2012 21:43:21 +0000 (14:43 -0700)
bin/repoman

index 3d1a4b0c160b2d04b1f194bc4e0bc1b28583a16e..1fc9acce228559819e6d489faae8bf94fd48ae5f 100755 (executable)
@@ -1347,17 +1347,6 @@ for x in effective_scanlist:
                        pkgs[pf] = Package(cpv=cpv, metadata=myaux,
                                root_config=root_config, type_name="ebuild")
 
-       # Sort ebuilds in ascending order for the KEYWORDS.dropped check.
-       pkgsplits = {}
-       for i in range(len(ebuildlist)):
-               ebuild_split = portage.pkgsplit(ebuildlist[i])
-               pkgsplits[ebuild_split] = ebuildlist[i]
-               ebuildlist[i] = ebuild_split
-       ebuildlist.sort(key=cmp_sort_key(portage.pkgcmp))
-       for i in range(len(ebuildlist)):
-               ebuildlist[i] = pkgsplits[ebuildlist[i]]
-       del pkgsplits
-
        slot_keywords = {}
 
        if len(pkgs) != len(ebuildlist):
@@ -1369,6 +1358,10 @@ for x in effective_scanlist:
                can_force = False
                continue
 
+       # Sort ebuilds in ascending order for the KEYWORDS.dropped check.
+       ebuildlist = sorted(pkgs.values())
+       ebuildlist = [pkg.pf for pkg in ebuildlist]
+
        for y in checkdirlist:
                m = disallowed_filename_chars_re.search(y.strip(os.sep))
                if m is not None: