Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-commits
Navigation:
Lists: gentoo-commits: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-commits@g.o
From: "Zac Medico (zmedico)" <zmedico@g.o>
Subject: portage r9877 - main/branches/2.1.2/bin
Date: Sun, 13 Apr 2008 22:19:48 +0000
Author: zmedico
Date: 2008-04-13 22:19:47 +0000 (Sun, 13 Apr 2008)
New Revision: 9877

Modified:
   main/branches/2.1.2/bin/emerge
Log:
Improve lookahead for new-style virtuals:

* Substitute the graph tree for the vartree in dep_check() since we
  want atom selections to be consistent with package selections
  that have already been made.
* Add the selected package to the graph as soon as possible
  so that later dep_check() calls can use it as feedback
  for making more consistent atom selections.
* Expand all slots of new-style virtuals inside _dep_check_composite_db
  so that lookahead examines all matched slots.

This solves some cases of bug #1343, and extends the fix for bug
#141118 to work in cases when a virtual is not yet installed but
it has been pulled into the graph.

(trunk r9873)


Modified: main/branches/2.1.2/bin/emerge
===================================================================
--- main/branches/2.1.2/bin/emerge	2008-04-13 22:13:59 UTC (rev 9876)
+++ main/branches/2.1.2/bin/emerge	2008-04-13 22:19:47 UTC (rev 9877)
@@ -1742,7 +1742,11 @@
 			self._graph_trees[myroot]["vartree"] = self.trees[myroot]["vartree"]
 			del vardb, fakedb
 			self._filtered_trees[myroot] = {}
-			self._filtered_trees[myroot]["vartree"] = self.trees[myroot]["vartree"]
+			# Substitute the graph tree for the vartree in dep_check() since we
+			# want atom selections to be consistent with package selections
+			# have already been made.
+			self._filtered_trees[myroot]["vartree"] = \
+				self._graph_trees[myroot]["porttree"]
 			def filtered_tree():
 				pass
 			filtered_tree.dbapi = self._dep_check_composite_db(self, myroot)
@@ -2579,8 +2583,17 @@
 							arg.name in ("system", "world")):
 							return 0, myfavorites
 
-					self._dep_stack.append(
-						Dependency(atom=atom, onlydeps=onlydeps, root=myroot, parent=arg))
+					dep = Dependency(atom=atom, onlydeps=onlydeps,
+						root=myroot, parent=arg)
+					self._dep_stack.append(dep)
+
+					# Add the selected package to the graph as soon as possible
+					# so that later dep_check() calls can use it as feedback
+					# for making more consistent atom selections.
+					if not self._add_pkg(pkg, dep.parent,
+						priority=dep.priority, depth=dep.depth):
+						return 0, myfavorites
+
 					if not self._create_graph():
 						if isinstance(arg, SetArg):
 							sys.stderr.write(("\n\n!!! Problem resolving " + \
@@ -4513,12 +4526,20 @@
 				slots = set()
 				slots.add(pkg.metadata["SLOT"])
 				atom_cp = portage.dep_getkey(atom)
-				if atom_cp == pkg.cp:
-					graph_db = self._depgraph.mydbapi[self._root]
-					for cpv in graph_db.match(atom):
-						if portage.cpv_getkey(cpv) != pkg.cp:
-							continue
-						slots.add(graph_db.aux_get(cpv, ["SLOT"])[0])
+				if pkg.cp.startswith("virtual/"):
+					# For new-style virtual lookahead that occurs inside
+					# dep_check(), examine all slots. This is needed
+					# so that newer slots will not unnecessarily be pulled in
+					# when a satisfying lower slot is already installed. For
+					# example, if virtual/jdk-1.4 is satisfied via kaffe then
+					# there's no need to pull in a newer slot to satisfy a
+					# virtual/jdk dependency.
+					for db, pkg_type, built, installed, db_keys in \
+						self._depgraph._filtered_trees[self._root]["dbs"]:
+						for cpv in db.match(atom):
+							if portage.cpv_getkey(cpv) != pkg.cp:
+								continue
+							slots.add(db.aux_get(cpv, ["SLOT"])[0])
 				ret = []
 				if self._visible(pkg):
 					self._cpv_pkg_map[pkg.cpv] = pkg

-- 
gentoo-commits@g.o mailing list


Navigation:
Lists: gentoo-commits: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
gentoo-x86 commit in dev-java/joda-time: ChangeLog joda-time-1.5.2.ebuild
Next by thread:
gentoo-x86 commit in sys-apps/pciutils: pciutils-2.2.6-r2.ebuild pciutils-2.2.7.ebuild pciutils-2.2.3-r2.ebuild pciutils-2.2.6-r1.ebuild pciutils-2.2.4-r3.ebuild pciutils-2.2.8.ebuild pciutils-2.2.9.ebuild pciutils-2.2.7-r1.ebuild
Previous by date:
gentoo-x86 commit in dev-java/joda-time: ChangeLog joda-time-1.5.2.ebuild
Next by date:
gentoo-x86 commit in sys-apps/pciutils: pciutils-2.2.6-r2.ebuild pciutils-2.2.7.ebuild pciutils-2.2.3-r2.ebuild pciutils-2.2.6-r1.ebuild pciutils-2.2.4-r3.ebuild pciutils-2.2.8.ebuild pciutils-2.2.9.ebuild pciutils-2.2.7-r1.ebuild


Updated Apr 29, 2012

Summary: Archive of the gentoo-commits mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.