commit: d192213dab5b55fba9d200daad1cb2dde763136e Author: Zac Medico <zmedico <AT> gentoo <DOT> org> AuthorDate: Tue Feb 19 07:51:07 2019 +0000 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> CommitDate: Tue Feb 19 07:54:39 2019 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=d192213d
locks: check for removed lockfile only if unlinkfile is True 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 <zmedico <AT> 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)
