summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-10-21 02:24:01 +0000
committerZac Medico <zmedico@gentoo.org>2006-10-21 02:24:01 +0000
commitd3ab5b8377f831d57609fcba48c00ec467923167 (patch)
tree13e0301e7de4fff367f5700c4b765076f7aff17e /bin
parent04473478328d750b13032aa72942b216c074ffa4 (diff)
downloadportage-d3ab5b8377f831d57609fcba48c00ec467923167.tar.gz
portage-d3ab5b8377f831d57609fcba48c00ec467923167.tar.bz2
portage-d3ab5b8377f831d57609fcba48c00ec467923167.zip
Apply the fix for bug #152175 to system/world greedy behavior.
svn path=/main/trunk/; revision=4773
Diffstat (limited to 'bin')
-rwxr-xr-xbin/emerge19
1 files changed, 19 insertions, 0 deletions
diff --git a/bin/emerge b/bin/emerge
index 03a40ab1c..e84017be5 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -1579,6 +1579,8 @@ class depgraph:
def xcreate(self,mode="system"):
vardb = self.trees[self.target_root]["vartree"].dbapi
+ portdb = self.trees[self.target_root]["porttree"].dbapi
+ bindb = self.trees[self.target_root]["bintree"].dbapi
world_problems = False
if mode=="system":
mylist = getlist(self.settings, "system")
@@ -1611,6 +1613,23 @@ class depgraph:
myslots = set()
for cpv in vardb.match(mykey):
myslots.add(vardb.aux_get(cpv, ["SLOT"])[0])
+ if myslots:
+ best_pkgs = []
+ if "--usepkg" in self.myopts:
+ best_pkg = portage.best(bindb.match(atom))
+ if best_pkg:
+ best_slot = bindb.aux_get(best_pkg, ["SLOT"])[0]
+ best_pkgs.append(("binary", best_pkg, best_slot))
+ if "--usepkgonly" not in self.myopts:
+ best_pkg = portage.best(portdb.match(atom))
+ if best_pkg:
+ best_slot = portdb.aux_get(best_pkg, ["SLOT"])[0]
+ best_pkgs.append(("ebuild", best_pkg, best_slot))
+ if best_pkgs:
+ best_pkg = portage.best([x[1] for x in best_pkgs])
+ best_pkgs = [x for x in best_pkgs if x[1] == best_pkg]
+ best_slot = best_pkgs[0][2]
+ myslots.add(best_slot)
if len(myslots) > 1:
for myslot in myslots:
myslot_atom = "%s:%s" % (mykey, myslot)