Alpine build tools
Go to file
Natanael Copa 3da770ce35 abuild-fetch: simplify and fix locking
Simplify locking by using lockf(3). It is POSIX compatible and should
work over NFS.

Fix download race condition when:
1) host A creates lockfile and aquire lock to fetch from distfiles
   mirror
2) host B opens the lockfile and waits for lock
3) host A gets 404 from distfiles, releases lock and deletes the
   lockfile, which host A has an open file handle for
4) host B gets lock of the deleted file and downloads file
5) host A retries download and creates a new lockfile, but is not
   blocked by host B, even if it should

Solve this by releaseing the lock, give the other processes a chance
to aquire it (using sleep(0)), and then only delete the lockfile if:
a) download was successful (no 404) or b) no-one else has a lock.

This reverts commit 281720ec39 (abuild-fetch: aquire a second lock
using flock(2))

fixes #10026
2021-05-06 13:03:14 +02:00
tests tests: improve abuild-fetch locking test 2021-05-05 17:17:54 +02:00
.editorconfig .editorconfig: add Makefile rules 2020-03-23 13:16:01 +00:00
.gitignore add basic tests using bats 2019-11-07 11:32:37 +00:00
APKBUILD.5 APKBUILD.5: document options="lib64" 2020-10-29 12:05:43 +00:00
COPYING add license GPL-2.0-only WITH OpenSSL-Exception 2020-10-23 11:30:25 -03:00
Makefile make: add FILTER var to make check 2021-05-05 16:31:05 +02:00
abuild-fetch.c abuild-fetch: simplify and fix locking 2021-05-06 13:03:14 +02:00
abuild-gzsplit.c abuild-gzsplit: fix handling of pax headers 2020-07-08 12:44:40 +02:00
abuild-keygen.in abuild-keygen: abort on error 2021-04-28 10:24:24 +02:00
abuild-rmtemp.c *: say we are using GPL-2.0-only 2020-10-23 11:39:18 -03:00
abuild-sign.in *: say we are using GPL-2.0-only 2020-10-23 11:39:18 -03:00
abuild-sudo.c abuild-sudo: dont require root to be member of abuild group 2020-03-23 14:18:52 +00:00
abuild-tar.c abuild-tar: fix varioius compiler warnings 2020-07-06 10:59:56 +00:00
abuild.conf abuild.conf: add CARGO_BUILD_JOBS 2021-04-23 09:52:04 +02:00
abuild.in abuild: allow set extra options for apk index 2021-04-29 12:37:38 +02:00
abump.in abump: check version before we build 2021-04-29 13:02:10 +02:00
apkbuild-cpan.in apkbuild-cpan.in: package sort order on upgrade 2021-04-04 00:27:34 -03:00
apkbuild-gem-resolver.in add .editorconfig and fix code formatting 2016-08-20 16:16:37 +02:00
apkbuild-pypi.in apkbuild-pypi.in: remove empty variables 2021-01-23 20:43:26 +00:00
apkgrel.in *: say we are using GPL-2.0-only 2020-10-23 11:39:18 -03:00
bootchartd replace deprecated `...` syntax with $(...) in shell scripts 2016-08-23 00:09:07 +02:00
buildlab.in allow override sharedir for testing 2019-11-07 11:42:23 +00:00
checkapk.in *: say we are using GPL-2.0-only 2020-10-23 11:39:18 -03:00
config.guess Update config.guess, config.sub, to 2020-11-19 2021-01-04 20:28:09 +01:00
config.sub Update config.guess, config.sub, to 2020-11-19 2021-01-04 20:28:09 +01:00
functions.sh.in functions: add hostspecs for riscv32/riscv64 2020-05-28 13:12:22 -06:00
newapkbuild.1 newapkbuild.1: fix mdoc style 2018-10-03 08:24:18 +00:00
newapkbuild.in newapkbuild: use pytest for Python tests 2021-04-20 15:08:36 +00:00
sample.APKBUILD sample.APKBUILD: use https for sourceforge download links 2018-09-24 21:43:49 +02:00
sample.confd sample: use lowercase in init.d/conf.d sample files 2009-12-30 08:55:33 +00:00
sample.initd sample.initd: modernize 2016-06-13 12:34:05 +00:00
sample.post-install fix typo in sample for pre and post install 2020-02-05 17:27:26 +01:00
sample.pre-install fix typo in sample for pre and post install 2020-02-05 17:27:26 +01:00