index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Allan McRae <allan@archlinux.org> | 2018-06-19 21:08:28 +1000 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2018-07-19 12:23:25 +1000 |
commit | 9a8c7154b1b5842a08db27bd3c3a1607fa0c8f0f (patch) | |
tree | 3aad3240dee94f4387174755e0a824f70dbf49f8 | |
parent | 4fe9adf418467505884dcc6e9a6ae9239c06c5f8 (diff) |
-rw-r--r-- | scripts/makepkg.sh.in | 20 |
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 32423262..d35dd62d 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -1125,22 +1125,34 @@ check_build_status() { backup_package_variables() { local var for var in ${splitpkg_overrides[@]}; do - declare -p $var 2>/dev/null || printf '%s\n' "unset $var" + local indirect="${var}_backup" + eval "${indirect}=(\"\${$var[@]}\")" + done +} + +restore_package_variables() { + local var + for var in ${splitpkg_overrides[@]}; do + local indirect="${var}_backup" + if [[ -n ${!indirect} ]]; then + eval "${var}=(\"\${$indirect[@]}\")" + else + unset ${var} + fi done } run_split_packaging() { local pkgname_backup=("${pkgname[@]}") - local restore_package_variables for pkgname in ${pkgname_backup[@]}; do pkgdir="$pkgdirbase/$pkgname" mkdir "$pkgdir" - restore_package_variables="$(backup_package_variables)" + backup_package_variables run_package $pkgname tidy_install lint_package || exit $E_PACKAGE_FAILED create_package - eval "$restore_package_variables" + restore_package_variables done pkgname=("${pkgname_backup[@]}") create_debug_package |