[pacman-dev] [PATCH] makepkg: fix variable backup/restore for splitpkg

Allan McRae allan at archlinux.org
Tue Jun 9 00:19:47 EDT 2009


Allan McRae wrote:
> The backup and restore of variables that can be overridden while
> making split packages only dealt with the first element, not the
> whole array (FS#15010).  Adjust the bash voodoo to fix it...
>
> Signed-off-by: Allan McRae <allan at archlinux.org>
> ---
>  scripts/makepkg.sh.in |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
> index f46b7f8..e2e1604 100644
> --- a/scripts/makepkg.sh.in
> +++ b/scripts/makepkg.sh.in
> @@ -1262,7 +1262,7 @@ devel_update() {
>  backup_package_variables() {
>  	for var in ${splitpkg_overrides[@]}; do
>  		indirect="${var}_backup"
> -		eval "${indirect}=\"${!var}\""
> +		eval "${indirect}=(\${$var[@]})"
>   

Bonus points for anyone who understands what I was doing and what is 
being done now...  All I know is that is works!  :)

>  	done
>  }
>  
> @@ -1270,7 +1270,7 @@ restore_package_variables() {
>  	for var in ${splitpkg_overrides[@]}; do
>  		indirect="${var}_backup"
>  		if [ -n "${!indirect}" ]; then
> -			eval "${var}=\"${!indirect}\""
> +			eval "${var}=(\${$indirect[@]})"
>  		else
>  			unset ${var}
>  		fi
>   





More information about the pacman-dev mailing list