summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-07-20 22:13:32 +0000
committerZac Medico <zmedico@gentoo.org>2009-07-20 22:13:32 +0000
commit8baed026a01a362583356ae9b023ecb25601fbd5 (patch)
tree0c7ea23d34ec8ad970c06e33566cf228f4cdafce
parente7bcec0ac746c747d20f5d41199c1cc3b9ba615e (diff)
downloadportage-8baed026a01a362583356ae9b023ecb25601fbd5.tar.gz
portage-8baed026a01a362583356ae9b023ecb25601fbd5.tar.bz2
portage-8baed026a01a362583356ae9b023ecb25601fbd5.zip
Remove empty log files inside dblink.unmerge(). Thanks to Diego Pettenò
<flameeyes@gentoo.org> for reporting. svn path=/main/trunk/; revision=13843
-rw-r--r--pym/portage/dbapi/vartree.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index d92bdf9ef..fe9e8e67f 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -2187,6 +2187,18 @@ class dblink(object):
del e
unlockdir(catdir_lock)
+ if log_path is not None:
+ try:
+ st = os.stat(log_path)
+ except OSError:
+ pass
+ else:
+ if st.st_size == 0:
+ try:
+ os.unlink(log_path)
+ except OSError:
+ pass
+
if log_path is not None and os.path.exists(log_path):
# Restore this since it gets lost somewhere above and it
# needs to be set for _display_merge() to be able to log.