From 8baed026a01a362583356ae9b023ecb25601fbd5 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 20 Jul 2009 22:13:32 +0000 Subject: =?UTF-8?q?Remove=20empty=20log=20files=20inside=20dblink.unmerge(?= =?UTF-8?q?).=20Thanks=20to=20Diego=20Petten=C3=B2=20=20for=20reporting.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit svn path=/main/trunk/; revision=13843 --- pym/portage/dbapi/vartree.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'pym') 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. -- cgit v1.2.3-1-g7c22