summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-10-08 21:43:43 +0000
committerZac Medico <zmedico@gentoo.org>2006-10-08 21:43:43 +0000
commit5b80a67a44c895e60f120db0967a63d89429f8e7 (patch)
tree571286ac70ff182c1db0685e5569e618f1a4050c
parent3bcdd8545ef1cf245353a3ef35be9ac38ccb0aa1 (diff)
downloadportage-5b80a67a44c895e60f120db0967a63d89429f8e7.tar.gz
portage-5b80a67a44c895e60f120db0967a63d89429f8e7.tar.bz2
portage-5b80a67a44c895e60f120db0967a63d89429f8e7.zip
For bug #150361, implement greedy matching of command line atoms against relevant installed slots. This patch allows a subset of installed slots to be pulled in via operators such as > or <.
svn path=/main/trunk/; revision=4621
-rwxr-xr-xbin/emerge32
1 files changed, 32 insertions, 0 deletions
diff --git a/bin/emerge b/bin/emerge
index c60cd35bb..150b8732a 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -950,6 +950,38 @@ class depgraph:
print
sys.exit(1)
+ if "--update" in self.myopts:
+ """Make sure all installed slots are updated when possible. Do this
+ with --emptytree also, to ensure that all slots are remerged."""
+ vardb = self.trees[self.target_root]["vartree"].dbapi
+ greedy_atoms = []
+ raw_greedy = []
+ for i in xrange(len(self.args_keys)):
+ myatom = self.args_keys[i]
+ greedy_atoms.append(myatom)
+ raw_greedy.append(raw_args[i])
+ myslots = set()
+ for cpv in vardb.match(myatom):
+ myslots.add(vardb.aux_get(cpv, ["SLOT"])[0])
+ if len(myslots) > 1:
+ for myslot in myslots:
+ myslot_atom = "%s:%s" % \
+ (portage.dep_getkey(myatom), myslot)
+ available = False
+ if "--usepkgonly" not in self.myopts and \
+ self.trees[self.target_root][
+ "porttree"].dbapi.match(myslot_atom):
+ available = True
+ elif "--usepkg" in self.myopts and \
+ self.trees[self.target_root][
+ "bintree"].dbapi.match(myslot_atom):
+ available = True
+ if available:
+ greedy_atoms.append(myslot_atom)
+ raw_greedy.append(raw_args[i])
+ self.args_keys = greedy_atoms
+ raw_args = raw_greedy
+
for i in xrange(len(self.args_keys)):
mykey = self.args_keys[i]
try: