summaryrefslogtreecommitdiff
path: root/abuild.in
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2017-03-21 08:05:44 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2017-03-21 08:05:44 +0000
commit3b61bfb6445a71208e218828296b8ca3bb65932e (patch)
tree75b1cbd4aeb0bfa6c78e3aa9e7d4e3f002816dc5 /abuild.in
parent9c1595dc423970cf86ef371dd15df9b27d9baf81 (diff)
downloadabuild-3b61bfb6445a71208e218828296b8ca3bb65932e.tar.gz
abuild-3b61bfb6445a71208e218828296b8ca3bb65932e.tar.bz2
abuild-3b61bfb6445a71208e218828296b8ca3bb65932e.tar.xz
abuild-3b61bfb6445a71208e218828296b8ca3bb65932e.zip
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.
Diffstat (limited to 'abuild.in')
-rw-r--r--abuild.in29
1 files changed, 11 insertions, 18 deletions
diff --git a/abuild.in b/abuild.in
index 1eede20..903da3a 100644
--- a/abuild.in
+++ b/abuild.in
@@ -566,9 +566,9 @@ update_config_guess() {
runpart() {
local part=$1
[ -n "$DEBUG" ] && msg "$part"
- abuild_function=$part "$abuild_path" \
- $color_opt $nodeps $force $forceroot $keep $quiet \
- $install_deps $recursive $upgrade || die "$part failed"
+ trap "die '$part failed'" EXIT
+ $part
+ trap - EXIT
}
# override those in your build script
@@ -2340,22 +2340,15 @@ controldir="$pkgbasedir"/.control.${subpkgname:-$pkgname}
trap 'die "Aborted by user"' INT
-if [ "$abuild_function" ]; then
- _function=$abuild_function
- abuild_function=
- $_function
+[ -z "$subpkgdir" ] && set_xterm_title "abuild${CROSS_COMPILE+-$CARCH}: $pkgname"
-else
- [ -z "$subpkgdir" ] && set_xterm_title "abuild${CROSS_COMPILE+-$CARCH}: $pkgname"
-
- if [ -z "$1" ]; then
- set all
- fi
-
- while [ $# -gt 0 ]; do
- runpart $1
- shift
- done
+if [ -z "$1" ]; then
+ set all
fi
+while [ $# -gt 0 ]; do
+ runpart $1
+ shift
+done
+
cleanup