summaryrefslogtreecommitdiffstats
path: root/pym/_emerge
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-11-13 07:18:37 +0000
committerZac Medico <zmedico@gentoo.org>2008-11-13 07:18:37 +0000
commit8afed770e80514ed7a39eb768e56b51e6b3749ac (patch)
tree0a065a85e1b615eaea47ee930942c49b0db10ae0 /pym/_emerge
parente625e460265b155de46c0082eab7839f56086d03 (diff)
downloadportage-8afed770e80514ed7a39eb768e56b51e6b3749ac.tar.gz
portage-8afed770e80514ed7a39eb768e56b51e6b3749ac.tar.bz2
portage-8afed770e80514ed7a39eb768e56b51e6b3749ac.zip
Remove sets protection code from unmerge().
svn path=/main/branches/2.1.6/; revision=11879
Diffstat (limited to 'pym/_emerge')
-rw-r--r--pym/_emerge/__init__.py89
1 files changed, 1 insertions, 88 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 781a7bf01..a0b99a879 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -10738,31 +10738,7 @@ def unmerge(root_config, myopts, unmerge_action,
if vdb_lock:
vartree.dbapi.flush_cache()
portage.locks.unlockdir(vdb_lock)
-
- from portage._sets.base import EditablePackageSet
-
- # generate a list of package sets that are directly or indirectly listed in "world",
- # as there is no persistent list of "installed" sets
- installed_sets = ["world"]
- stop = False
- pos = 0
- while not stop:
- stop = True
- pos = len(installed_sets)
- for s in installed_sets[pos - 1:]:
- if s not in sets:
- continue
- candidates = [x[len(SETPREFIX):] for x in sets[s].getNonAtoms() if x.startswith(SETPREFIX)]
- if candidates:
- stop = False
- installed_sets += candidates
- installed_sets = [x for x in installed_sets if x not in root_config.setconfig.active]
- del stop, pos
-
- # we don't want to unmerge packages that are still listed in user-editable package sets
- # listed in "world" as they would be remerged on the next update of "world" or the
- # relevant package sets.
- unknown_sets = set()
+
for cp in xrange(len(pkgmap)):
for cpv in pkgmap[cp]["selected"].copy():
try:
@@ -10786,69 +10762,6 @@ def unmerge(root_config, myopts, unmerge_action,
pkgmap[cp]["protected"].add(cpv)
continue
- parents = []
- for s in installed_sets:
- # skip sets that the user requested to unmerge, and skip world
- # unless we're unmerging a package set (as the package would be
- # removed from "world" later on)
- if s in root_config.setconfig.active or (s == "world" and not root_config.setconfig.active):
- continue
-
- if s not in sets:
- if s in unknown_sets:
- continue
- unknown_sets.add(s)
- out = portage.output.EOutput()
- out.eerror(("Unknown set '@%s' in " + \
- "%svar/lib/portage/world_sets") % \
- (s, root_config.root))
- continue
-
- # only check instances of EditablePackageSet as other classes are generally used for
- # special purposes and can be ignored here (and are usually generated dynamically, so the
- # user can't do much about them anyway)
- if isinstance(sets[s], EditablePackageSet):
-
- # This is derived from a snippet of code in the
- # depgraph._iter_atoms_for_pkg() method.
- for atom in sets[s].iterAtomsForPackage(pkg):
- inst_matches = vartree.dbapi.match(atom)
- inst_matches.reverse() # descending order
- higher_slot = None
- for inst_cpv in inst_matches:
- try:
- inst_pkg = _pkg(inst_cpv)
- except KeyError:
- # It could have been uninstalled
- # by a concurrent process.
- continue
-
- if inst_pkg.cp != atom.cp:
- continue
- if pkg >= inst_pkg:
- # This is descending order, and we're not
- # interested in any versions <= pkg given.
- break
- if pkg.slot_atom != inst_pkg.slot_atom:
- higher_slot = inst_pkg
- break
- if higher_slot is None:
- parents.append(s)
- break
- if parents:
- #print colorize("WARN", "Package %s is going to be unmerged," % cpv)
- #print colorize("WARN", "but still listed in the following package sets:")
- #print " %s\n" % ", ".join(parents)
- print colorize("WARN", "Not unmerging package %s as it is" % cpv)
- print colorize("WARN", "still referenced by the following package sets:")
- print " %s\n" % ", ".join(parents)
- # adjust pkgmap so the display output is correct
- pkgmap[cp]["selected"].remove(cpv)
- all_selected.remove(cpv)
- pkgmap[cp]["protected"].add(cpv)
-
- del installed_sets
-
numselected = len(all_selected)
if not numselected:
writemsg_level(