From a323da487a2380484e6c23514cc1f75b8e8ceaaf Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 19 Dec 2011 12:44:47 -0800 Subject: [PATCH] Display EROOT when ROOT != "/". Since commit a715b65f7bd36409c1283e6911265d1f4405ab7a, the Package.root and RootConfig.root attributes refer to EROOT instead of ROOT. Therefore, adjust display code so that EROOT is only displayed when ROOT != "/". --- pym/_emerge/MergeListItem.py | 2 +- pym/_emerge/PackageMerge.py | 2 +- pym/_emerge/Scheduler.py | 8 ++++---- pym/_emerge/depgraph.py | 10 +++++----- pym/_emerge/main.py | 5 +++-- pym/_emerge/resolver/output.py | 2 +- pym/_emerge/resolver/slot_collision.py | 2 +- 7 files changed, 16 insertions(+), 15 deletions(-) diff --git a/pym/_emerge/MergeListItem.py b/pym/_emerge/MergeListItem.py index 2176bf65a..8086c689a 100644 --- a/pym/_emerge/MergeListItem.py +++ b/pym/_emerge/MergeListItem.py @@ -68,7 +68,7 @@ class MergeListItem(CompositeTask): pkg_repo_name = "unknown repo" msg += " from %s" % pkg_repo_name - if pkg.root != "/": + if pkg.root_config.settings["ROOT"] != "/": msg += " %s %s" % (preposition, pkg.root) if not build_opts.pretend: diff --git a/pym/_emerge/PackageMerge.py b/pym/_emerge/PackageMerge.py index f8fa04a38..eed34e99b 100644 --- a/pym/_emerge/PackageMerge.py +++ b/pym/_emerge/PackageMerge.py @@ -28,7 +28,7 @@ class PackageMerge(CompositeTask): counter_str, colorize("GOOD", pkg.cpv)) - if pkg.root != "/": + if pkg.root_config.settings["ROOT"] != "/": msg += " %s %s" % (preposition, pkg.root) if not self.merge.build_opts.fetchonly and \ diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py index 3800b8b1c..d09b474e1 100644 --- a/pym/_emerge/Scheduler.py +++ b/pym/_emerge/Scheduler.py @@ -425,7 +425,7 @@ class Scheduler(PollScheduler): msg = [""] for pkg in interactive_tasks: pkg_str = " " + colorize("INFORM", str(pkg.cpv)) - if pkg.root != "/": + if pkg.root_config.settings["ROOT"] != "/": pkg_str += " for " + pkg.root msg.append(pkg_str) msg.append("") @@ -1251,7 +1251,7 @@ class Scheduler(PollScheduler): # Skip this if $ROOT != / since it shouldn't matter if there # are unsatisfied system runtime deps in this case. - if pkg.root != '/': + if pkg.root_config.settings["ROOT"] != "/": return completed_tasks = self._completed_tasks @@ -1711,7 +1711,7 @@ class Scheduler(PollScheduler): pkg = failed_pkg.pkg msg = "%s to %s %s" % \ (bad("Failed"), action, colorize("INFORM", pkg.cpv)) - if pkg.root != "/": + if pkg.root_config.settings["ROOT"] != "/": msg += " %s %s" % (preposition, pkg.root) log_path = self._locate_failure_log(failed_pkg) @@ -1841,7 +1841,7 @@ class Scheduler(PollScheduler): pkg = task msg = "emerge --keep-going:" + \ " %s" % (pkg.cpv,) - if pkg.root != "/": + if pkg.root_config.settings["ROOT"] != "/": msg += " for %s" % (pkg.root,) msg += " dropped due to unsatisfied dependency." for line in textwrap.wrap(msg, msg_width): diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 93819c611..2c44ce1d3 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -594,7 +594,7 @@ class depgraph(object): for pkg, flags in self._dynamic_config.ignored_binaries.items(): writemsg(" =%s" % pkg.cpv, noiselevel=-1) - if pkg.root != '/': + if pkg.root_config.settings["ROOT"] != "/": writemsg(" for %s" % (pkg.root,), noiselevel=-1) writemsg("\n use flag(s): %s\n" % ", ".join(sorted(flags)), noiselevel=-1) @@ -679,7 +679,7 @@ class depgraph(object): "due to unsatisfied dependencies:\n\n", noiselevel=-1) writemsg(str(pkg.slot_atom), noiselevel=-1) - if pkg.root != '/': + if pkg.root_config.settings["ROOT"] != "/": writemsg(" for %s" % (pkg.root,), noiselevel=-1) writemsg("\n", noiselevel=-1) @@ -695,7 +695,7 @@ class depgraph(object): "!!! triggered by backtracking:\n\n", noiselevel=-1) for pkg, parent_atoms in backtrack_masked: writemsg(str(pkg.slot_atom), noiselevel=-1) - if pkg.root != '/': + if pkg.root_config.settings["ROOT"] != "/": writemsg(" for %s" % (pkg.root,), noiselevel=-1) writemsg("\n", noiselevel=-1) @@ -712,7 +712,7 @@ class depgraph(object): indent = " " for pkg, parent_atoms in missed_updates: msg.append(str(pkg.slot_atom)) - if pkg.root != '/': + if pkg.root_config.settings["ROOT"] != "/": msg.append(" for %s" % (pkg.root,)) msg.append("\n\n") @@ -2930,7 +2930,7 @@ class depgraph(object): xinfo = _unicode_decode('"%s"') % (myparent,) # Discard null/ from failed cpv_expand category expansion. xinfo = xinfo.replace("null/", "") - if root != "/": + if root != self._frozen_config._running_root.root: xinfo = "%s for %s" % (xinfo, root) masked_packages = [] missing_use = [] diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py index 0a9bd1d70..d02f2a605 100644 --- a/pym/_emerge/main.py +++ b/pym/_emerge/main.py @@ -1547,9 +1547,10 @@ def repo_name_duplicate_check(trees): def config_protect_check(trees): for root, root_trees in trees.items(): - if not root_trees["root_config"].settings.get("CONFIG_PROTECT"): + settings = root_trees["root_config"].settings + if not settings.get("CONFIG_PROTECT"): msg = "!!! CONFIG_PROTECT is empty" - if root != "/": + if settings["ROOT"] != "/": msg += " for '%s'" % root msg += "\n" writemsg_level(msg, level=logging.WARN, noiselevel=-1) diff --git a/pym/_emerge/resolver/output.py b/pym/_emerge/resolver/output.py index b73b19061..bed5e44e8 100644 --- a/pym/_emerge/resolver/output.py +++ b/pym/_emerge/resolver/output.py @@ -833,7 +833,7 @@ class Display(object): if self.include_mask_str(): addl += self.gen_mask_str(pkg) - if pkg.root != "/": + if pkg.root_config.settings["ROOT"] != "/": if pkg_info.oldbest: pkg_info.oldbest += " " if self.conf.columns: diff --git a/pym/_emerge/resolver/slot_collision.py b/pym/_emerge/resolver/slot_collision.py index 320713882..1d522aabd 100644 --- a/pym/_emerge/resolver/slot_collision.py +++ b/pym/_emerge/resolver/slot_collision.py @@ -244,7 +244,7 @@ class slot_conflict_handler(object): for (slot_atom, root), pkgs \ in self.slot_collision_info.items(): msg.append(str(slot_atom)) - if root != '/': + if root != self.depgraph._frozen_config._running_root.root: msg.append(" for %s" % (root,)) msg.append("\n\n") -- 2.26.2