From 5b80a67a44c895e60f120db0967a63d89429f8e7 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 8 Oct 2006 21:43:43 +0000 Subject: [PATCH] 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 --- bin/emerge | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) 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: -- 2.26.2