summaryrefslogtreecommitdiffstats
path: root/pym/portage/dbapi/vartree.py
diff options
context:
space:
mode:
Diffstat (limited to 'pym/portage/dbapi/vartree.py')
-rw-r--r--pym/portage/dbapi/vartree.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index fe9e8e67f..88ec7b3c7 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -2038,6 +2038,7 @@ class dblink(object):
catdir_lock = None
scheduler = self._scheduler
retval = -1
+ failures = 0
try:
if myebuildpath:
catdir_lock = lockdir(catdir)
@@ -2065,6 +2066,7 @@ class dblink(object):
# XXX: Decide how to handle failures here.
if retval != os.EX_OK:
+ failures += 1
writemsg(_("!!! FAILED prerm: %s\n") % retval, noiselevel=-1)
self._unmerge_pkgfiles(pkgfiles, others_in_slot)
@@ -2087,6 +2089,7 @@ class dblink(object):
# XXX: Decide how to handle failures here.
if retval != os.EX_OK:
+ failures += 1
writemsg(_("!!! FAILED postrm: %s\n") % retval, noiselevel=-1)
# Skip this if another package in the same slot has just been
@@ -2188,6 +2191,13 @@ class dblink(object):
unlockdir(catdir_lock)
if log_path is not None:
+
+ if not failures and 'unmerge-logs' not in self.settings.features:
+ try:
+ os.unlink(log_path)
+ except OSError:
+ pass
+
try:
st = os.stat(log_path)
except OSError: