Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 689604 Details for
Bug 774384
sys-apps/portage-prefix: Add option to disable locking or use symlinks for systems that do not support hardlinks
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
_get_lock_fn: test fcntl.flock and hardlink_lockfile
_get_lock_fn-test-fcntl.flock-and-hardlink_lockfile.patch (text/plain), 1.24 KB, created by
Zac Medico
on 2021-03-06 08:36:49 UTC
(
hide
)
Description:
_get_lock_fn: test fcntl.flock and hardlink_lockfile
Filename:
MIME Type:
Creator:
Zac Medico
Created:
2021-03-06 08:36:49 UTC
Size:
1.24 KB
patch
obsolete
>From d06db1fb33f50ea47dbf84016ca80d70a5f840c1 Mon Sep 17 00:00:00 2001 >From: Zac Medico <zmedico@gentoo.org> >Date: Sat, 6 Mar 2021 00:25:16 -0800 >Subject: [PATCH] _get_lock_fn: test fcntl.flock and hardlink_lockfile > >TODO: Add fallback to handle missing hardlink permission for android. > >Bug: https://bugs.gentoo.org/774384 >Signed-off-by: Zac Medico <zmedico@gentoo.org> >--- > lib/portage/locks.py | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > >diff --git a/lib/portage/locks.py b/lib/portage/locks.py >index 4d0eede50..b1670fe5c 100644 >--- a/lib/portage/locks.py >+++ b/lib/portage/locks.py >@@ -54,6 +54,23 @@ def _get_lock_fn(): > _lock_fn = fcntl.lockf > return _lock_fn > >+ if _test_lock_fn( >+ lambda path, fd, flags: functools.partial( >+ unlockfile, (path, fcntl.flock(fd, flags), 0, fcntl.flock) >+ ) >+ ): >+ _lock_fn = fcntl.flock >+ return _lock_fn >+ >+ if not _test_lock_fn( >+ lambda path, fd, flags: hardlink_lockfile( >+ path, flags=(os.O_NONBLOCK if flags & fcntl.LOCK_NB else 0) >+ ) >+ and functools.partial(unlockfile, (path, HARDLINK_FD, 0, None)) >+ ): >+ # TODO: Add fallback to handle missing hardlink permission for android (bug 774384) >+ pass >+ > # Fall back to fcntl.flock. > _lock_fn = fcntl.flock > return _lock_fn >-- >2.26.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 774384
: 689604