abuild: fix runpart

we need to run the function for runpart in the same shell, otherwise we
will lose the global variables set in the split functions.
This commit is contained in:
Natanael Copa 2017-03-21 08:05:44 +00:00
parent 9c1595dc42
commit 3b61bfb644

View File

@ -566,9 +566,9 @@ update_config_guess() {
runpart() { runpart() {
local part=$1 local part=$1
[ -n "$DEBUG" ] && msg "$part" [ -n "$DEBUG" ] && msg "$part"
abuild_function=$part "$abuild_path" \ trap "die '$part failed'" EXIT
$color_opt $nodeps $force $forceroot $keep $quiet \ $part
$install_deps $recursive $upgrade || die "$part failed" trap - EXIT
} }
# override those in your build script # override those in your build script
@ -2340,12 +2340,6 @@ controldir="$pkgbasedir"/.control.${subpkgname:-$pkgname}
trap 'die "Aborted by user"' INT trap 'die "Aborted by user"' INT
if [ "$abuild_function" ]; then
_function=$abuild_function
abuild_function=
$_function
else
[ -z "$subpkgdir" ] && set_xterm_title "abuild${CROSS_COMPILE+-$CARCH}: $pkgname" [ -z "$subpkgdir" ] && set_xterm_title "abuild${CROSS_COMPILE+-$CARCH}: $pkgname"
if [ -z "$1" ]; then if [ -z "$1" ]; then
@ -2356,6 +2350,5 @@ else
runpart $1 runpart $1
shift shift
done done
fi
cleanup cleanup