Revert "makepkg: use the declare
builtin when backing up variables to eval"
This reverts commit 9e52a36794
.
The change to use declare for the split package metadata backup/restore
resulted in variables being declared at a local scope. When these variables
were unset (mostly noticed with debug packaging) this left the variable at
global scope defined. Revert back to the known good state.
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
4fe9adf418
commit
9a8c7154b1
1 changed files with 16 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue