summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-06-12 02:52:41 +0000
committerZac Medico <zmedico@gentoo.org>2007-06-12 02:52:41 +0000
commitf9e6439685818e289b6a16217cef1944252ab4b8 (patch)
tree052c7b20ad0c05bf285a8c82ff314dc06b8d4391 /pym
parentc39a80441b3fffefa099286f7710f7ab4e923990 (diff)
downloadportage-f9e6439685818e289b6a16217cef1944252ab4b8.tar.gz
portage-f9e6439685818e289b6a16217cef1944252ab4b8.tar.bz2
portage-f9e6439685818e289b6a16217cef1944252ab4b8.zip
For bug #181021, during unmerge use all slot matches for reference counts (in case the user has set AUTOCLEAN=no). (trunk r6814)
svn path=/main/branches/2.1.2/; revision=6815
Diffstat (limited to 'pym')
-rw-r--r--pym/portage.py38
1 files changed, 16 insertions, 22 deletions
diff --git a/pym/portage.py b/pym/portage.py
index ee7b9c4a0..3d202d07e 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -7153,27 +7153,21 @@ class dblink:
writemsg_stdout("No package files given... Grabbing a set.\n")
pkgfiles=self.getcontents()
- if not new_contents:
- counter = self.vartree.dbapi.cpv_counter(self.mycpv)
- slot = self.vartree.dbapi.aux_get(self.mycpv, ["SLOT"])[0]
- slot_matches = self.vartree.dbapi.match(
- "%s:%s" % (dep_getkey(self.mycpv), slot))
- new_cpv = None
- if slot_matches:
- max_counter = -1
- for cur_cpv in slot_matches:
- cur_counter = self.vartree.dbapi.cpv_counter(cur_cpv)
- if cur_counter == counter and \
- cur_cpv == self.mycpv:
- continue
- if cur_counter > max_counter:
- max_counter = cur_counter
- new_cpv = cur_cpv
- if new_cpv:
- # The current instance has been replaced by a newer instance.
- new_cat, new_pkg = catsplit(new_cpv)
- new_contents = dblink(new_cat, new_pkg, self.vartree.root,
- self.settings, vartree=self.vartree).getcontents()
+ counter = self.vartree.dbapi.cpv_counter(self.mycpv)
+ slot = self.vartree.dbapi.aux_get(self.mycpv, ["SLOT"])[0]
+ slot_matches = self.vartree.dbapi.match(
+ "%s:%s" % (dep_getkey(self.mycpv), slot))
+ claimed_paths = set()
+ if new_contents:
+ claimed_paths.update(new_contents)
+ for cur_cpv in slot_matches:
+ cur_counter = self.vartree.dbapi.cpv_counter(cur_cpv)
+ if cur_counter == counter and \
+ cur_cpv == self.mycpv:
+ continue
+ claimed_paths.update(dblink(self.cat, catsplit(cur_cpv)[1],
+ self.vartree.root, self.settings,
+ vartree=self.vartree).getcontents())
if pkgfiles:
mykeys=pkgfiles.keys()
@@ -7185,7 +7179,7 @@ class dblink:
modprotect="/lib/modules/"
for objkey in mykeys:
obj = normalize_path(objkey)
- if new_contents and obj in new_contents:
+ if obj in claimed_paths:
# A new instance of this package claims the file, so don't
# unmerge it.
writemsg_stdout("--- !owned %s %s\n" % \