diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-12-02 07:58:07 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-12-02 07:58:07 +0000 |
commit | ee8f242c098b51363941f047f2c22f4ae1ea6aae (patch) | |
tree | 272ea98b1837b1ec9facbb341aec1d9d52bc8dd3 | |
parent | 345398ce5329b234c80c95020630995031f7e309 (diff) | |
download | portage-ee8f242c098b51363941f047f2c22f4ae1ea6aae.tar.gz portage-ee8f242c098b51363941f047f2c22f4ae1ea6aae.tar.bz2 portage-ee8f242c098b51363941f047f2c22f4ae1ea6aae.zip |
In dblink.treewalk(), tweak the "Safely unmerging
already-installed instance" logic to make sure that
it works in all possible cases.
svn path=/main/trunk/; revision=8801
-rw-r--r-- | pym/portage/dbapi/vartree.py | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index e0cc8e45b..874a0e501 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -2004,6 +2004,16 @@ class dblink(object): outfile.flush() outfile.close() + # These caches are populated during collision-protect and the data + # they contain is now invalid. It's very important to invalidate + # the contents_inodes cache so that FEATURES=unmerge-orphans + # doesn't unmerge anything that belongs to this package that has + # just been merged. + others_in_slot.append(self) # self has just been merged + for dblnk in others_in_slot: + dblnk.contentscache = None + dblnk._contents_inodes = None + # If portage is reinstalling itself, remove the old # version now since we want to use the temporary # PORTAGE_BIN_PATH that will be removed when we return. @@ -2013,19 +2023,13 @@ class dblink(object): "portage" == pkgsplit(self.pkg)[0]: reinstall_self = True - for dblnk in others_in_slot: + for dblnk in list(others_in_slot): + if dblnk is self: + continue if dblnk.mycpv != self.mycpv and \ not reinstall_self: continue writemsg_stdout(">>> Safely unmerging already-installed instance...\n") - # These caches are populated during collision-protect and the data - # they contain is now invalid. It's very important to invalidate - # the contents_inodes cache so that FEATURES=unmerge-orphans - # doesn't unmerge anything that belongs to this package that has - # just been merged. - self.contentscache = None - self._contents_inodes = None - others_in_slot.append(self) # self has just been merged others_in_slot.remove(dblnk) # dblnk will unmerge itself now dblnk.unmerge(trimworld=0, ldpath_mtimes=prev_mtimes, others_in_slot=others_in_slot) |