Check for a removed lockfile only if unlinkfile is True, since
in this case the parent directory must be writable. This fixes
emergelog usage where the parent directory is not writable.

Bug: https://bugs.gentoo.org/678278
Signed-off-by: Zac Medico <zmed...@gentoo.org>
---
 lib/portage/locks.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/portage/locks.py b/lib/portage/locks.py
index 510925da0..a23d5cb56 100644
--- a/lib/portage/locks.py
+++ b/lib/portage/locks.py
@@ -273,7 +273,7 @@ def lockfile(mypath, wantnewlockfile=0, unlinkfile=0,
 
                
        if isinstance(lockfilename, basestring) and \
-               myfd != HARDLINK_FD and _lockfile_was_removed(myfd, 
lockfilename):
+               myfd != HARDLINK_FD and unlinkfile and 
_lockfile_was_removed(myfd, lockfilename):
                # The file was deleted on us... Keep trying to make one...
                os.close(myfd)
                writemsg(_("lockfile recurse\n"), 1)
-- 
2.18.1


Reply via email to