public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Fabian Groffen" <grobian@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:prefix commit in: pym/_emerge/
Date: Sat,  5 Feb 2011 12:25:06 +0000 (UTC)	[thread overview]
Message-ID: <f90df89f9053bdad96d61935d704f33239f3fed5.grobian@gentoo> (raw)

commit:     f90df89f9053bdad96d61935d704f33239f3fed5
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Fri Feb  4 17:41:30 2011 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Feb  4 17:41:30 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=f90df89f

depgraph: make downgrades trigger complete graph

It's common for downgrades to break dependencies, as in bug #353613, so
automatically trigger complete graph mode when a downgrade is found.

---
 pym/_emerge/depgraph.py |   23 +++++++++++++++++++++--
 1 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py
index 4334a33..f131889 100644
--- a/pym/_emerge/depgraph.py
+++ b/pym/_emerge/depgraph.py
@@ -3456,8 +3456,27 @@ class depgraph(object):
 			return 1
 
 		if "complete" not in self._dynamic_config.myparams:
-			# Skip this to avoid consuming enough time to disturb users.
-			return 1
+			# Automatically enable complete mode if there are any
+			# downgrades, since they often break dependencies
+			# (like in bug #353613).
+			have_downgrade = False
+			for node in self._dynamic_config.digraph:
+				if not isinstance(node, Package) or \
+					node.operation != "merge":
+					continue
+				vardb = self._frozen_config.roots[
+					node.root].trees["vartree"].dbapi
+				inst_pkg = vardb.match_pkgs(node.slot_atom)
+				if inst_pkg and inst_pkg[0] > node:
+					have_downgrade = True
+					break
+
+			if have_downgrade:
+				self._dynamic_config.myparams["complete"] = True
+			else:
+				# Skip complete graph mode, in order to avoid consuming
+				# enough time to disturb users.
+				return 1
 
 		self._load_vdb()
 



             reply	other threads:[~2011-02-05 13:04 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-05 12:25 Fabian Groffen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-05-25 19:32 [gentoo-commits] proj/portage:prefix commit in: pym/_emerge/ Fabian Groffen
2017-03-24 19:09 Fabian Groffen
2017-03-24 19:09 Fabian Groffen
2017-03-24  7:43 Fabian Groffen
2015-06-02 17:42 Fabian Groffen
2013-03-23 22:00 Fabian Groffen
2013-02-28 20:12 Fabian Groffen
2012-09-30 11:33 Fabian Groffen
2012-09-06 18:14 Fabian Groffen
2012-02-09  8:05 Fabian Groffen
2011-08-31 18:47 Fabian Groffen
2011-08-29 19:03 Fabian Groffen
2011-08-25 20:26 Fabian Groffen
2011-07-26 17:58 Fabian Groffen
2011-03-13 15:02 Fabian Groffen
2011-02-05 12:25 Fabian Groffen
2011-02-05 12:25 Fabian Groffen
2011-02-05 12:25 Fabian Groffen
2011-02-05 12:23 Fabian Groffen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f90df89f9053bdad96d61935d704f33239f3fed5.grobian@gentoo \
    --to=grobian@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox