summaryrefslogtreecommitdiffstats
path: root/pym/portage.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-03-30 06:33:22 +0000
committerZac Medico <zmedico@gentoo.org>2008-03-30 06:33:22 +0000
commit3ffe211817464baea790446d05eacd8b6e59d016 (patch)
tree1d0762a5e625413ddddf68d16708b39702f46e7a /pym/portage.py
parentb0e56e905476fdd79231b9bcce64842ba53a4394 (diff)
downloadportage-3ffe211817464baea790446d05eacd8b6e59d016.tar.gz
portage-3ffe211817464baea790446d05eacd8b6e59d016.tar.bz2
portage-3ffe211817464baea790446d05eacd8b6e59d016.zip
Move the AUTOCLEAN code into dblink.treewalk since it's already partially
supported there anyway (for replacement of identical cpv). This has the benefit of guaranteeing that the order of installation and removal phases is always the same. (trunk r9621) svn path=/main/branches/2.1.2/; revision=9622
Diffstat (limited to 'pym/portage.py')
-rw-r--r--pym/portage.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 7db532787..5844bef4b 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -9219,11 +9219,11 @@ class dblink:
"portage" == pkgsplit(self.pkg)[0]:
reinstall_self = True
+ autoclean = self.settings.get("AUTOCLEAN", "yes") == "yes"
for dblnk in list(others_in_slot):
if dblnk is self:
continue
- if dblnk.mycpv != self.mycpv and \
- not reinstall_self:
+ if not (autoclean or dblnk.mycpv == self.mycpv or reinstall_self):
continue
writemsg_stdout(">>> Safely unmerging already-installed instance...\n")
others_in_slot.remove(dblnk) # dblnk will unmerge itself now
@@ -9232,8 +9232,11 @@ class dblink:
# TODO: Check status and abort if necessary.
dblnk.delete()
writemsg_stdout(">>> Original instance of package unmerged safely.\n")
- if not reinstall_self:
- break
+
+ if len(others_in_slot) > 1:
+ writemsg_stdout(colorize("WARN", "WARNING:")
+ + " AUTOCLEAN is disabled. This can cause serious"
+ + " problems due to overlapping packages.\n")
# We hold both directory locks.
self.dbdir = self.dbpkgdir