summaryrefslogtreecommitdiffstats
path: root/pym/portage/_global_updates.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2010-08-01 01:14:51 -0700
committerZac Medico <zmedico@gentoo.org>2010-08-01 01:14:51 -0700
commit7f59dca5ca8a7a8fd5cda5912174698b93dc0dac (patch)
treec20be4baa92d0abcf77ffd38e8e11c4cb16d81eb /pym/portage/_global_updates.py
parent3282ac5c7b9ec7102a8ac6683c1647366cee0ba8 (diff)
downloadportage-7f59dca5ca8a7a8fd5cda5912174698b93dc0dac.tar.gz
portage-7f59dca5ca8a7a8fd5cda5912174698b93dc0dac.tar.bz2
portage-7f59dca5ca8a7a8fd5cda5912174698b93dc0dac.zip
Make update_config_files() take a dict of {repo_name: list} since it's more
efficient this way, and this function can't be called separately for each repo if /etc/portage is under CONFIG_PROTECT (because it would produce separate updated files for each repo).
Diffstat (limited to 'pym/portage/_global_updates.py')
-rw-r--r--pym/portage/_global_updates.py25
1 files changed, 21 insertions, 4 deletions
diff --git a/pym/portage/_global_updates.py b/pym/portage/_global_updates.py
index 7e6ae3300..e9ec45305 100644
--- a/pym/portage/_global_updates.py
+++ b/pym/portage/_global_updates.py
@@ -142,10 +142,6 @@ def _global_updates(trees, prev_mtimes):
if _world_repo_match(atom, new_atom):
world_list[pos] = new_atom
world_modified = True
- update_config_files(root,
- shlex_split(mysettings.get("CONFIG_PROTECT", "")),
- shlex_split(mysettings.get("CONFIG_PROTECT_MASK", "")),
- myupd, match_callback=_world_repo_match)
for update_cmd in myupd:
if update_cmd[0] == "move":
@@ -167,6 +163,27 @@ def _global_updates(trees, prev_mtimes):
if retupd:
+ def _config_repo_match(repo_name, atoma, atomb):
+ """
+ Check whether to perform a world change from atoma to atomb.
+ If best vardb match for atoma comes from the same repository
+ as the update file, allow that. Additionally, if portdb still
+ can find a match for old atom name, warn about that.
+ """
+ matches = vardb.match(atoma)
+ if not matches:
+ matches = vardb.match(atomb)
+ if not matches:
+ return False
+ repository = vardb.aux_get(best(matches), ['repository'])[0]
+ return repository == repo_name or \
+ (repo_name == master_repo and repository not in repo_map)
+
+ update_config_files(root,
+ shlex_split(mysettings.get("CONFIG_PROTECT", "")),
+ shlex_split(mysettings.get("CONFIG_PROTECT_MASK", "")),
+ repo_map, match_callback=_config_repo_match)
+
# The above global updates proceed quickly, so they
# are considered a single mtimedb transaction.
if timestamps: