diff options
-rwxr-xr-x | bin/emerge | 13 | ||||
-rw-r--r-- | pym/portage.py | 11 |
2 files changed, 7 insertions, 17 deletions
diff --git a/bin/emerge b/bin/emerge index 15196cb72..f62ff44c1 100755 --- a/bin/emerge +++ b/bin/emerge @@ -4450,19 +4450,6 @@ class MergeTask(object): if "--pretend" not in self.myopts and \ "--fetchonly" not in self.myopts and \ "--fetch-all-uri" not in self.myopts: - # Clean the old package that we have merged over top of it. - if pkgsettings.get("AUTOCLEAN", "yes") == "yes": - xsplit=portage.pkgsplit(x[2]) - emergelog(xterm_titles, " >>> AUTOCLEAN: " + xsplit[0]) - retval = unmerge(pkgsettings, self.myopts, vartree, - "clean", [xsplit[0]], ldpath_mtimes, autoclean=1) - if not retval: - emergelog(xterm_titles, - " --- AUTOCLEAN: Nothing unmerged.") - else: - portage.writemsg_stdout(colorize("WARN", "WARNING:") - + " AUTOCLEAN is disabled. This can cause serious" - + " problems due to overlapping packages.\n") # Figure out if we need a restart. mysplit=portage.pkgsplit(x[2]) 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 |