Commit 138cfd70 authored by Natanael Copa's avatar Natanael Copa

abuild: wait for lockfile on delete of dependencies

parent 3af17782
...@@ -21,6 +21,7 @@ BUILD_BASE="build-base" ...@@ -21,6 +21,7 @@ BUILD_BASE="build-base"
SUDO=${SUDO:-"sudo"} SUDO=${SUDO:-"sudo"}
FAKEROOT=${FAKEROOT:-"fakeroot"} FAKEROOT=${FAKEROOT:-"fakeroot"}
APK=${APK:-apk} APK=${APK:-apk}
apk_opt_wait="--wait 30"
# read config # read config
ABUILD_CONF=${ABUILD_CONF:-"$sysconfdir/abuild.conf"} ABUILD_CONF=${ABUILD_CONF:-"$sysconfdir/abuild.conf"}
...@@ -82,7 +83,7 @@ set_xterm_title() { ...@@ -82,7 +83,7 @@ set_xterm_title() {
cleanup() { cleanup() {
set_xterm_title "" set_xterm_title ""
if [ -z "$install_after" ] && [ -n "$uninstall_after" ]; then if [ -z "$install_after" ] && [ -n "$uninstall_after" ]; then
$SUDO $APK del $uninstall_after $SUDO $APK del $apk_opt_wait $uninstall_after
fi fi
} }
...@@ -1104,10 +1105,10 @@ builddeps() { ...@@ -1104,10 +1105,10 @@ builddeps() {
# make a --simluate run first to detect missing deps # make a --simluate run first to detect missing deps
# apk-tools --virtual is no goot at reporting those. # apk-tools --virtual is no goot at reporting those.
$SUDO $APK add --repository "$abuildrepo" \ $SUDO $APK add --repository "$abuildrepo" \
--wait 30 \ $apk_opt_wait \
--simulate --quiet $deps || return 1 --simulate --quiet $deps || return 1
$SUDO $APK add --repository "$abuildrepo" \ $SUDO $APK add --repository "$abuildrepo" \
--wait 30 \ $apk_opt_wait \
--virtual .makedepends-$pkgname $deps \ --virtual .makedepends-$pkgname $deps \
&& return 0 && return 0
fi fi
...@@ -1139,7 +1140,7 @@ builddeps() { ...@@ -1139,7 +1140,7 @@ builddeps() {
$recursive $upgrade $color_opt abuildindex || return 1 $recursive $upgrade $color_opt abuildindex || return 1
done done
$SUDO $APK add -u --repository "$abuildrepo" \ $SUDO $APK add -u --repository "$abuildrepo" \
--wait 30 \ $apk_opt_wait \
--virtual .makedepends-$pkgname $deps --virtual .makedepends-$pkgname $deps
} }
...@@ -1253,18 +1254,18 @@ post_add() { ...@@ -1253,18 +1254,18 @@ post_add() {
post_add $i || return 1 post_add $i || return 1
fi fi
done done
$SUDO $APK add --wait 30 -u "$pkgf" || die "Failed to install $1" $SUDO $APK add $apk_opt_wait -u "$pkgf" || die "Failed to install $1"
} }
installdeps() { installdeps() {
local deps i local deps i
$SUDO $APK add --wait 30 --repository "$abuildrepo" \ $SUDO $APK add $apk_opt_wait --repository "$abuildrepo" \
--virtual .makedepends-$pkgname \ --virtual .makedepends-$pkgname \
$makedepends $makedepends
} }
uninstalldeps (){ uninstalldeps (){
$SUDO $APK del .makedepends-$pkgname $SUDO $APK del $apk_opt_wait .makedepends-$pkgname
} }
all() { all() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment