summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-12-13 21:50:19 +0000
committerZac Medico <zmedico@gentoo.org>2006-12-13 21:50:19 +0000
commit0c172f4b896b2047f3d114b97782c57fc6a3ef30 (patch)
tree9676e39a8b5a6d59c506addec66561bd8e9ea093
parent5e9bf090557029d8e463aa95923f16e030c44bd1 (diff)
downloadportage-0c172f4b896b2047f3d114b97782c57fc6a3ef30.tar.gz
portage-0c172f4b896b2047f3d114b97782c57fc6a3ef30.tar.bz2
portage-0c172f4b896b2047f3d114b97782c57fc6a3ef30.zip
For bug #157897, handle the case of multiple versions within a single package slot have been pulled into the dependency graph. If possible, the package that has already been pulled in will be reused. Otherwise, an error message will advise the user to mask an unwanted version.
svn path=/main/trunk/; revision=5285
-rwxr-xr-xbin/emerge32
1 files changed, 32 insertions, 0 deletions
diff --git a/bin/emerge b/bin/emerge
index 3a4545150..f820a3491 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -1436,6 +1436,38 @@ class depgraph:
# ordered by type preference ("ebuild" type is the last resort)
selected_pkg = matched_packages[0]
+ pkgtype, myroot, mycpv, myuse = selected_pkg
+ mydbapi = self.trees[myroot][self.pkg_tree_map[pkgtype]].dbapi
+ slot_atom = "%s:%s" % (portage.dep_getkey(mycpv),
+ mydbapi.aux_get(mycpv, ["SLOT"])[0])
+ existing_node = self._slot_node_map[myroot].get(
+ slot_atom, None)
+ if existing_node:
+ e_type, myroot, e_cpv, e_status = existing_node
+ if portage.match_from_list(x, [e_cpv]):
+ # The existing node can be reused.
+ selected_pkg = [e_type, myroot, e_cpv,
+ self.useFlags[myroot][e_cpv]]
+ else:
+ # In some cases it may be possible to resolve this
+ # automatically, but support for backtracking
+ # (removing nodes that have already been selected) will
+ # be required in order to handle all possible cases
+ print "\n!!! Multiple versions within a single " + \
+ "package slot have been pulled into the"
+ print "!!! dependency graph:"
+ print
+ for cpv in (mycpv, e_cpv):
+ print " ", cpv
+ print
+ print "It may be possible to solve this problem " + \
+ "by using package.mask to prevent on of"
+ print "those packages from being selected. For " + \
+ "more information, see MASKED PACKAGES"
+ print "section in the emerge man page or refer to " + \
+ "the Gentoo Handbook."
+ print
+ return 0
if myparent:
#we are a dependency, so we want to be unconditionally added