Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 335106 Details for
Bug 451082
distutils-r1: finding a better image merging method
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Suggested (temporary) solution
0001-Use-locking-to-avoid-race-conditions-and-tar-on-Free.patch (text/plain), 1.29 KB, created by
Michał Górny
on 2013-01-10 21:17:21 UTC
(
hide
)
Description:
Suggested (temporary) solution
Filename:
MIME Type:
Creator:
Michał Górny
Created:
2013-01-10 21:17:21 UTC
Size:
1.29 KB
patch
obsolete
>From 3ba7093a77622c254c2c1cdebfd089165ae5fa9e Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> >Date: Thu, 10 Jan 2013 22:15:18 +0100 >Subject: [PATCH] Use locking to avoid race conditions, and 'tar' on FreeBSD. > >--- > gx86/eclass/distutils-r1.eclass | 21 ++++++++++++++++++++- > 1 file changed, 20 insertions(+), 1 deletion(-) > >diff --git a/gx86/eclass/distutils-r1.eclass b/gx86/eclass/distutils-r1.eclass >index 96e0027..308572e 100644 >--- a/gx86/eclass/distutils-r1.eclass >+++ b/gx86/eclass/distutils-r1.eclass >@@ -345,7 +345,26 @@ _distutils-r1_merge_root() { > local src=${1} > local dest=${2} > >- cp -a -l -n "${src}"/. "${dest}"/ || die "Merging ${EPYTHON} image failed." >+ local lockfile=${T}/distutils-r1-merge-lock >+ >+ if type -P lockf &>/dev/null; then >+ # On BSD, we have 'lockf' wrapper. >+ tar -C "${src}" -f - -c . \ >+ | lockf "${lockfile}" tar -x -f - -C "${dest}" >+ else >+ if type -P flock &>/dev/null; then >+ # On Linux, we have 'flock' which can lock fd. >+ local lock_fd >+ redirect_alloc_fd lock_fd "${lockfile}" '>>' >+ flock ${lock_fd} >+ else >+ ewarn "distutils-r1: no locking service found, please report." >+ fi >+ >+ cp -a -l -n "${src}"/. "${dest}"/ >+ fi >+ [[ ${?} == 0 ]] || die "Merging ${EPYTHON} image failed." >+ > rm -rf "${src}" > } > >-- >1.8.1 >
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 451082
:
334986
|
334988
| 335106