From bc094693b719ec3e7f45e19fccda192df8d356f6 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 25 Jun 2006 09:43:31 +0000 Subject: [PATCH] Pass in just the CONFIG_PROTECT info instead of the whole config object. svn path=/main/trunk/; revision=3653 --- pym/portage.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/pym/portage.py b/pym/portage.py index 962ef7ba5..d78d72f2b 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -6857,8 +6857,12 @@ def portageexit(): atexit_register(portageexit) -def update_config_files(config_root, mysettings, update_iter): - """Perform global updates on /etc/portage/package.* and the world file.""" +def update_config_files(config_root, protect, protect_mask, update_iter): + """Perform global updates on /etc/portage/package.* and the world file. + config_root - location of files to update + protect - list of paths from CONFIG_PROTECT + protect_mask - list of paths from CONFIG_PROTECT_MASK + update_iter - list of update commands as returned from parse_updates()""" update_files={} file_contents={} myxfiles = ["package.mask","package.unmask","package.keywords","package.use"] @@ -6908,9 +6912,7 @@ def update_config_files(config_root, mysettings, update_iter): write_atomic(os.path.join(config_root, WORLD_FILE), "\n".join(worldlist)) - protect_obj = config_protect(config_root, - mysettings.get("CONFIG_PROTECT","").split(), - mysettings.get("CONFIG_PROTECT_MASK","").split()) + protect_obj = config_protect(config_root, protect, protect_mask) for x in update_files: updating_file = os.path.join(abs_user_config, x) if protect_obj.isprotected(updating_file): @@ -6955,7 +6957,11 @@ def global_updates(mysettings, trees, prev_mtimes): else: for msg in errors: writemsg("%s\n" % msg, noiselevel=-1) - update_config_files("/", mysettings, myupd) + + update_config_files("/", + mysettings.get("CONFIG_PROTECT","").split(), + mysettings.get("CONFIG_PROTECT_MASK","").split(), + myupd) trees["/"]["bintree"] = binarytree("/", mysettings["PKGDIR"], settings=mysettings) -- 2.26.2