From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 715AC138244 for ; Wed, 2 Jan 2013 07:29:56 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4EDD3E0459; Wed, 2 Jan 2013 07:29:48 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7C07FE0459 for ; Wed, 2 Jan 2013 07:29:47 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4FE6533D9C6 for ; Wed, 2 Jan 2013 07:29:46 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id B9A17E5439 for ; Wed, 2 Jan 2013 07:29:43 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1357111768.b732f13e7ef217d5f9bdbab9d5da0ad6b99da04e.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: pym/_emerge/Scheduler.py pym/_emerge/actions.py pym/_emerge/depgraph.py X-VCS-Directories: pym/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: b732f13e7ef217d5f9bdbab9d5da0ad6b99da04e X-VCS-Branch: master Date: Wed, 2 Jan 2013 07:29:43 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: f3abde94-1397-4cfa-a76d-4045c4c5ac76 X-Archives-Hash: 36f04c2be57027de06717408a472ea0d commit: b732f13e7ef217d5f9bdbab9d5da0ad6b99da04e Author: Zac Medico gentoo org> AuthorDate: Wed Jan 2 06:03:54 2013 +0000 Commit: Zac Medico gentoo org> CommitDate: Wed Jan 2 07:29:28 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b732f13e resume_depgraph: check for alternative installed When pruning packages from the merge list, only prune them if the relevant dependency is not satisfied by an alternative package which is already installed. This should fix bug #448176, and now there's also reasons logged for why a particular package is dropped. --- pym/_emerge/Scheduler.py | 9 ++++++--- pym/_emerge/actions.py | 10 ++++++++-- pym/_emerge/depgraph.py | 23 ++++++++++++++--------- 3 files changed, 28 insertions(+), 14 deletions(-) diff --git a/pym/_emerge/Scheduler.py b/pym/_emerge/Scheduler.py index 6a49497..a7c303b 100644 --- a/pym/_emerge/Scheduler.py +++ b/pym/_emerge/Scheduler.py @@ -1791,7 +1791,7 @@ class Scheduler(PollScheduler): # scope e = exc mydepgraph = e.depgraph - dropped_tasks = set() + dropped_tasks = {} if e is not None: def unsatisfied_resume_dep_msg(): @@ -1841,7 +1841,7 @@ class Scheduler(PollScheduler): self._init_graph(mydepgraph.schedulerGraph()) msg_width = 75 - for task in dropped_tasks: + for task, atom in dropped_tasks.items(): if not (isinstance(task, Package) and task.operation == "merge"): continue pkg = task @@ -1849,7 +1849,10 @@ class Scheduler(PollScheduler): " %s" % (pkg.cpv,) if pkg.root_config.settings["ROOT"] != "/": msg += " for %s" % (pkg.root,) - msg += " dropped due to unsatisfied dependency." + if atom is None: + msg += " dropped because it is masked or unavailable" + else: + msg += " dropped because it requires %s" % atom for line in textwrap.wrap(msg, msg_width): eerror(line, phase="other", key=pkg.cpv) settings = self.pkgsettings[pkg.root] diff --git a/pym/_emerge/actions.py b/pym/_emerge/actions.py index 6a3815a..7473098 100644 --- a/pym/_emerge/actions.py +++ b/pym/_emerge/actions.py @@ -286,8 +286,14 @@ def action_build(settings, trees, mtimedb, "dropped due to\n" + \ "!!! masking or unsatisfied dependencies:\n\n", noiselevel=-1) - for task in dropped_tasks: - portage.writemsg(" " + str(task) + "\n", noiselevel=-1) + for task, atom in dropped_tasks.items(): + if atom is None: + writemsg(" %s is masked or unavailable\n" % + (task,), noiselevel=-1) + else: + writemsg(" %s requires %s\n" % (task, atom), + noiselevel=-1) + portage.writemsg("\n", noiselevel=-1) del dropped_tasks else: diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 47f1b60..31cf77c 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -7477,7 +7477,7 @@ def _resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner): skip_masked = True skip_unsatisfied = True mergelist = mtimedb["resume"]["mergelist"] - dropped_tasks = set() + dropped_tasks = {} frozen_config = _frozen_depgraph_config(settings, trees, myopts, spinner) while True: @@ -7491,12 +7491,16 @@ def _resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner): raise graph = mydepgraph._dynamic_config.digraph - unsatisfied_parents = dict((dep.parent, dep.parent) \ + unsatisfied_parents = dict((dep.parent, dep.atom) \ for dep in e.value) traversed_nodes = set() - unsatisfied_stack = list(unsatisfied_parents) + unsatisfied_stack = list(unsatisfied_parents.items()) while unsatisfied_stack: - pkg = unsatisfied_stack.pop() + pkg, atom = unsatisfied_stack.pop() + if atom is not None and \ + mydepgraph._select_pkg_from_installed( + pkg.root, atom) != (None, None): + continue if pkg in traversed_nodes: continue traversed_nodes.add(pkg) @@ -7505,7 +7509,8 @@ def _resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner): # package scheduled for merge, removing this # package may cause the the parent package's # dependency to become unsatisfied. - for parent_node in graph.parent_nodes(pkg): + for parent_node, atom in \ + mydepgraph._dynamic_config._parent_atoms.get(pkg, []): if not isinstance(parent_node, Package) \ or parent_node.operation not in ("merge", "nomerge"): continue @@ -7513,8 +7518,8 @@ def _resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner): # ensure that a package with an unsatisfied depenedency # won't get pulled in, even indirectly via a soft # dependency. - unsatisfied_parents[parent_node] = parent_node - unsatisfied_stack.append(parent_node) + unsatisfied_parents[parent_node] = atom + unsatisfied_stack.append((parent_node, atom)) unsatisfied_tuples = frozenset(tuple(parent_node) for parent_node in unsatisfied_parents @@ -7535,8 +7540,8 @@ def _resume_depgraph(settings, trees, mtimedb, myopts, myparams, spinner): # Exclude installed packages that have been removed from the graph due # to failure to build/install runtime dependencies after the dependent # package has already been installed. - dropped_tasks.update(pkg for pkg in \ - unsatisfied_parents if pkg.operation != "nomerge") + dropped_tasks.update((pkg, atom) for pkg, atom in \ + unsatisfied_parents.items() if pkg.operation != "nomerge") del e, graph, traversed_nodes, \ unsatisfied_parents, unsatisfied_stack