dependencies.
.TP
.BR "\-\-deselect[=n]"
-Remove atoms from the world file. This action is implied
+Remove atoms and/or sets from the world file. This action is implied
by uninstall actions, including \fB-\-depclean\fR,
\fB-\-prune\fR and \fB-\-unmerge\fR. Use \fB-\-deselect=n\fR
in order to prevent uninstall actions from removing
expanded_atoms = set(atoms)
from portage.dep import Atom
for atom in atoms:
- for cpv in vardb.match(atom):
- slot, = vardb.aux_get(cpv, ['SLOT'])
- if not slot:
- slot = '0'
- expanded_atoms.add(Atom('%s:%s' % (portage.cpv_getkey(cpv), slot)))
+ if not atom.startswith(SETPREFIX):
+ for cpv in vardb.match(atom):
+ slot, = vardb.aux_get(cpv, ['SLOT'])
+ if not slot:
+ slot = '0'
+ expanded_atoms.add(Atom('%s:%s' % (portage.cpv_getkey(cpv), slot)))
pretend = '--pretend' in opts
locked = False
discard_atoms = set()
world_set.load()
for atom in world_set:
- if not isinstance(atom, Atom):
- # nested set
- continue
for arg_atom in expanded_atoms:
- if arg_atom.intersects(atom) and \
- not (arg_atom.slot and not atom.slot):
- discard_atoms.add(atom)
- break
+ if arg_atom.startswith(SETPREFIX):
+ if arg_atom == atom:
+ discard_atoms.add(atom)
+ break
+ else:
+ if arg_atom.intersects(atom) and \
+ not (arg_atom.slot and not atom.slot):
+ discard_atoms.add(atom)
+ break
if discard_atoms:
for atom in sorted(discard_atoms):
print(">>> Removing %s from \"world\" favorites file..." % \
# multiple files in a single iter_owners() call.
lookup_owners.append(x)
+ elif x.startswith(SETPREFIX) and action == "deselect":
+ valid_atoms.append(x)
+
else:
msg = []
msg.append("'%s' is not a valid package atom." % (x,))
print(" " + green("--deselect") + "[=%s]" % turquoise("n"))
paragraph = \
- "Remove atoms from the world file. This action is implied " + \
+ "Remove atoms and/or sets from the world file. This action is implied " + \
"by uninstall actions, including --depclean, " + \
"--prune and --unmerge. Use --deselect=n " + \
"in order to prevent uninstall actions from removing " + \