summaryrefslogtreecommitdiffhomepage
path: root/subr/pkg_install.subr
diff options
context:
space:
mode:
Diffstat (limited to 'subr/pkg_install.subr')
-rw-r--r--subr/pkg_install.subr14
1 files changed, 14 insertions, 0 deletions
diff --git a/subr/pkg_install.subr b/subr/pkg_install.subr
index 4bc789ef..ffe2d8dd 100644
--- a/subr/pkg_install.subr
+++ b/subr/pkg_install.subr
@@ -22,7 +22,21 @@ pkg_install() {
return 1;
fi;
done; IFS="${_ifs_old}";
+ (set +o errexit -o noglob; trap "rm -f \"${BUILD_DLCACHEDIR}/install.lock\"" EXIT;
+ date; echo trying to grab lock
+ while true; do
+ if flock -E 622 -w 600 4; then
+ break;
+ elif [ "${?}" -eq 622 ]; then
+ continue;
+ else
+ exit "${?}";
+ fi;
+ done;
if ! tar -C "${PKG_DESTDIR}" -cpf - . | tar -C "${PKG_PREFIX}" --overwrite -xpf -; then
+ exit 1;
+ fi) 4<>"${BUILD_WORKDIR}/install.lock";
+ if [ "${?}" -ne 0 ]; then
return 1;
elif [ "${PKG_PKGLIST_DISABLE:-0}" -eq 0 ]; then
if [ ! -e "${PREFIX}/pkglist.${PKG_BUILD_TYPE}" ]\