From: Zac Medico Date: Wed, 13 Dec 2006 21:50:19 +0000 (-0000) Subject: For bug #157897, handle the case of multiple versions within a single package slot... X-Git-Tag: v2.1.2~306 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0c172f4b896b2047f3d114b97782c57fc6a3ef30;p=portage.git 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 --- 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