diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-07-20 22:13:32 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-07-20 22:13:32 +0000 |
commit | 8baed026a01a362583356ae9b023ecb25601fbd5 (patch) | |
tree | 0c7ea23d34ec8ad970c06e33566cf228f4cdafce | |
parent | e7bcec0ac746c747d20f5d41199c1cc3b9ba615e (diff) | |
download | portage-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.py | 12 |
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. |