public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-portage-dev] [PATCH] locks: check for removed lockfile only if unlinkfile is True
@ 2019-02-19  7:58 Zac Medico
  0 siblings, 0 replies; only message in thread
From: Zac Medico @ 2019-02-19  7:58 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Zac Medico

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@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



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-02-19  8:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-19  7:58 [gentoo-portage-dev] [PATCH] locks: check for removed lockfile only if unlinkfile is True Zac Medico

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox