summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-10-21 01:26:19 +0000
committerZac Medico <zmedico@gentoo.org>2006-10-21 01:26:19 +0000
commit04473478328d750b13032aa72942b216c074ffa4 (patch)
tree27d8baf060c3f7f59a3d466573b5c094cea3ec29
parent46108379af2fb58450b17228bd0ebbaa72431414 (diff)
downloadportage-04473478328d750b13032aa72942b216c074ffa4.tar.gz
portage-04473478328d750b13032aa72942b216c074ffa4.tar.bz2
portage-04473478328d750b13032aa72942b216c074ffa4.zip
For bug #152175, trigger greedy --update behavior when an atom matches a slot that isn't installed yet.
svn path=/main/trunk/; revision=4772
-rwxr-xr-xbin/emerge17
1 files changed, 17 insertions, 0 deletions
diff --git a/bin/emerge b/bin/emerge
index 70cdee79b..03a40ab1c 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -1048,6 +1048,23 @@ class depgraph:
myslots = set()
for cpv in vardb.match(myatom):
myslots.add(vardb.aux_get(cpv, ["SLOT"])[0])
+ if myslots:
+ best_pkgs = []
+ if "--usepkg" in self.myopts:
+ best_pkg = portage.best(bindb.match(myatom))
+ 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(myatom))
+ 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" % \