* Make _world_repo_match() try to match both atoms, so it still works
authorZac Medico <zmedico@gentoo.org>
Sun, 1 Aug 2010 09:33:08 +0000 (02:33 -0700)
committerZac Medico <zmedico@gentoo.org>
Sun, 1 Aug 2010 09:33:08 +0000 (02:33 -0700)
  if the world file and vdb are slighly out of sync wrt package moves.
* Write world file updates at the earliest opportunity.

pym/portage/_global_updates.py

index e9ec45305096498fd061af996e035b10cb173b4e..ed51411214b975222166214ba2bab042296394d2 100644 (file)
@@ -127,6 +127,8 @@ def _global_updates(trees, prev_mtimes):
                                can find a match for old atom name, warn about that.
                                """
                                matches = vardb.match(atoma)
+                               if not matches:
+                                       matches = vardb.match(atomb)
                                if matches and \
                                        repo_match(vardb.aux_get(best(matches), ['repository'])[0]):
                                        if portdb.match(atoma):
@@ -161,6 +163,15 @@ def _global_updates(trees, prev_mtimes):
                                                if moves:
                                                        writemsg_stdout(moves * "S")
 
+       if world_modified:
+               world_list.sort()
+               write_atomic(world_file,
+                       "".join("%s\n" % (x,) for x in world_list))
+               if world_warnings:
+                       # XXX: print warning that we've updated world entries
+                       # and the old name still matches something (from an overlay)?
+                       pass
+
        if retupd:
 
                        def _config_repo_match(repo_name, atoma, atomb):
@@ -222,13 +233,4 @@ def _global_updates(trees, prev_mtimes):
                                writemsg_stdout(bold(_("Note: This can take a very long time.")))
                                writemsg_stdout("\n")
 
-       if world_modified:
-               world_list.sort()
-               write_atomic(world_file,
-                       "".join("%s\n" % (x,) for x in world_list))
-               if world_warnings:
-                       # XXX: print warning that we've updated world entries
-                       # and the old name still matches something (from an overlay)?
-                       pass
-
        return retupd