aboutsummaryrefslogtreecommitdiffstats
path: root/main/abuild
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-08-26 09:20:14 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2015-08-26 09:20:52 +0200
commitfd2d5633fcea1fb35f3b67dfe1c51aebcac3696f (patch)
treecc8e195cfa2752545e5f7c0478ef66168f10953e /main/abuild
parent2815b6ca49e235e2231bb6e094c8fb6e68715c1b (diff)
downloadaports-fd2d5633fcea1fb35f3b67dfe1c51aebcac3696f.tar.bz2
aports-fd2d5633fcea1fb35f3b67dfe1c51aebcac3696f.tar.xz
main/abuild: workaround for fetching files to an nfs share
Diffstat (limited to 'main/abuild')
-rw-r--r--main/abuild/0001-abuild-workaround-with-fetch-lock-file-on-nfs.patch47
-rw-r--r--main/abuild/APKBUILD12
2 files changed, 55 insertions, 4 deletions
diff --git a/main/abuild/0001-abuild-workaround-with-fetch-lock-file-on-nfs.patch b/main/abuild/0001-abuild-workaround-with-fetch-lock-file-on-nfs.patch
new file mode 100644
index 0000000000..83a79f09b6
--- /dev/null
+++ b/main/abuild/0001-abuild-workaround-with-fetch-lock-file-on-nfs.patch
@@ -0,0 +1,47 @@
+From 8468825035d1c0af12abbb67aea85260cd048946 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Wed, 26 Aug 2015 08:14:36 +0200
+Subject: [PATCH] abuild: workaround with fetch lock file on nfs
+
+flock(2) on an NFS mount will on the server side convert the lock to a
+POSIX lock (fcntl(F_SETLK)). This means that abuild running on NFS
+server and client will create different locks and they will both try
+download same file at same time.
+
+The proper fix would be to patch curl to have an option to create a
+posix lock for the downlaoded file or create a flock -c like wrapper
+that creates posix lock.
+
+Meanwhile, we implement a stupid test for existance of the lockfile
+before we go on. This is not race-safe because other process could
+create the lockfile after the [ -e $lockfile ] test and before the file
+is created.
+
+At least it is not worse that no locking at all.
+---
+ abuild.in | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/abuild.in b/abuild.in
+index b8d8851..f01fe2b 100644
+--- a/abuild.in
++++ b/abuild.in
+@@ -342,6 +342,15 @@ uri_fetch() {
+ mkdir -p "$SRCDEST"
+
+ CLEANUP_FILES="$CLEANUP_FILES $lockfile"
++
++ # best-effort workaround for NFS which has issues with flock
++ if [ -e "$lockfile" ]; then
++ msg "Waiting for ${lockfile##*/}..."
++ while [ -e "$lockfile" ]; do
++ sleep 0.5s
++ done
++ fi
++
+ (
+ flock -n -x 9 || msg "Waiting for ${lockfile##*/}..."
+ flock -x 9
+--
+2.5.0
+
diff --git a/main/abuild/APKBUILD b/main/abuild/APKBUILD
index c565ad6bd2..b26f8f6c32 100644
--- a/main/abuild/APKBUILD
+++ b/main/abuild/APKBUILD
@@ -2,7 +2,7 @@
pkgname=abuild
pkgver=2.24.0
_ver=${pkgver%_git*}
-pkgrel=0
+pkgrel=1
pkgdesc="Script to build Alpine Packages"
url="http://git.alpinelinux.org/cgit/abuild/"
arch="all"
@@ -20,6 +20,7 @@ subpackages="apkbuild-cpan:cpan apkbuild-gem-resolver:gems"
options="suid"
pkggroups="abuild"
source="http://dev.alpinelinux.org/archive/abuild/abuild-$_ver.tar.xz
+ 0001-abuild-workaround-with-fetch-lock-file-on-nfs.patch
"
_builddir="$srcdir/$pkgname-$_ver"
@@ -64,6 +65,9 @@ gems() {
mv "$pkgdir"/usr/bin/apkbuild-gem-resolver "$subpkgdir"/usr/bin/
}
-md5sums="7821eea872e86a768d881fecce95e934 abuild-2.24.0.tar.xz"
-sha256sums="0e0c0c7579c3b8d6668fad9d93a42f3ea18da88679e1a12a178f2676c79e94d6 abuild-2.24.0.tar.xz"
-sha512sums="360d0164afed9c61576618d113d738327151c60f1bc1e6246fcf74f97db087ca2effb11a4ae045f1f288063d5311c6dddbe7721b3cbe65d11472b3d2b0f03ef6 abuild-2.24.0.tar.xz"
+md5sums="7821eea872e86a768d881fecce95e934 abuild-2.24.0.tar.xz
+f8ae835a70e5accbc1a02d3daf470a23 0001-abuild-workaround-with-fetch-lock-file-on-nfs.patch"
+sha256sums="0e0c0c7579c3b8d6668fad9d93a42f3ea18da88679e1a12a178f2676c79e94d6 abuild-2.24.0.tar.xz
+4438e69a4e23beec50e3f6def7c91b1ca7c12b1ff71c3e918fc4b4cab1976136 0001-abuild-workaround-with-fetch-lock-file-on-nfs.patch"
+sha512sums="360d0164afed9c61576618d113d738327151c60f1bc1e6246fcf74f97db087ca2effb11a4ae045f1f288063d5311c6dddbe7721b3cbe65d11472b3d2b0f03ef6 abuild-2.24.0.tar.xz
+1b0481f70cc3a28990985eded62a62c64b261a785278b765cc275f844b32859acce59478170f08242de2f2c89f97e848f792271102be3d6dea0c94d6deea03c0 0001-abuild-workaround-with-fetch-lock-file-on-nfs.patch"