From 4c341455d665ae68e19b5ddd269c45afe04c0c31 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 1 Aug 2010 02:33:08 -0700 Subject: * Make _world_repo_match() try to match both atoms, so it still works 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 | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'pym/portage/_global_updates.py') diff --git a/pym/portage/_global_updates.py b/pym/portage/_global_updates.py index e9ec45305..ed5141121 100644 --- a/pym/portage/_global_updates.py +++ b/pym/portage/_global_updates.py @@ -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 -- cgit v1.2.3-1-g7c22