diff options
-rwxr-xr-x | bin/emerge | 32 |
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: |