Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-commits
Navigation:
Lists: gentoo-commits: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-commits@g.o
From: "Zac Medico (zmedico)" <zmedico@g.o>
Subject: portage r12184 - main/trunk/bin
Date: Tue, 09 Dec 2008 07:52:36 +0000
Author: zmedico
Date: 2008-12-09 07:52:36 +0000 (Tue, 09 Dec 2008)
New Revision: 12184

Modified:
   main/trunk/bin/dispatch-conf
Log:
For py3k compat, avoid using list.sort(cmp).


Modified: main/trunk/bin/dispatch-conf
===================================================================
--- main/trunk/bin/dispatch-conf	2008-12-09 04:57:01 UTC (rev 12183)
+++ main/trunk/bin/dispatch-conf	2008-12-09 07:52:36 UTC (rev 12184)
@@ -326,25 +326,29 @@
         We keep ._cfg0002_conf over ._cfg0001_conf and ._cfg0000_conf.
         """
         h = {}
-
+        configs = []
         newconfigs.sort ()
 
         for nconf in newconfigs:
             nconf = nconf.rstrip ()
             conf  = re.sub (r'\._cfg\d+_', '', nconf)
-            dir   = re.match (r'^(.+)/', nconf).group (1)
+            dirname   = os.path.dirname(nconf)
+            conf_map  = {
+                'current' : conf,
+                'dir'     : dirname,
+                'new'     : nconf,
+            }
 
             if conf in h:
                 mrgconf = re.sub(r'\._cfg', '._mrg', h[conf]['new'])
                 if os.path.exists(mrgconf):
                     os.unlink(mrgconf)
                 os.unlink(h[conf]['new'])
+                h[conf].update(conf_map)
+            else:
+                h[conf] = conf_map
+                configs.append(conf_map)
 
-            h [conf] = { 'current' : conf, 'dir' : dir, 'new' : nconf }
-
-        configs = h.values ()
-        configs.sort (lambda a, b: cmp(a ['current'], b ['current']))
-
         return configs
 
 



Navigation:
Lists: gentoo-commits: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
gentoo-x86 commit in x11-plugins/pidgin-facebookchat: pidgin-facebookchat-1.43.ebuild ChangeLog
Next by thread:
gentoo-x86 commit in dev-perl/PDL/files: PDL-2.4.4-PIC.patch
Previous by date:
gentoo-x86 commit in x11-plugins/pidgin-facebookchat: pidgin-facebookchat-1.43.ebuild ChangeLog
Next by date:
gentoo-x86 commit in dev-perl/PDL: ChangeLog PDL-2.4.4.ebuild


Updated Jun 01, 2012

Summary: Archive of the gentoo-commits mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.