[pacman-dev] [PATCH v4 2/4] libmakepkg: lint disallowed architecture specific variables

Allan McRae allan at archlinux.org
Mon Jan 21 21:35:23 UTC 2019


On 16/1/19 8:34 am, morganamilo wrote:
> Variables such as 'pkgdesc_x86_64' are invalid, instead of ignoring them
> raise an error.
> 
> Signed-off-by: morganamilo <morganamilo at gmail.com>
> ---
>  .../libmakepkg/lint_pkgbuild/variable.sh.in   | 22 +++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/scripts/libmakepkg/lint_pkgbuild/variable.sh.in b/scripts/libmakepkg/lint_pkgbuild/variable.sh.in
> index ad3ffd8e..b65c01f2 100644
> --- a/scripts/libmakepkg/lint_pkgbuild/variable.sh.in
> +++ b/scripts/libmakepkg/lint_pkgbuild/variable.sh.in
> @@ -66,6 +66,14 @@ lint_variable() {
>  				fi
>  			fi
>  		done
> +
> +		for i in ${array[@]} ${string[@]}; do
> +			v="${i}_${a}"
> +			if declare -p "$v" > /dev/null 2>&1; then
> +				error "$(gettext "%s can not be architecture specific: $s_$s")" "$i"
> +				ret=1
> +			fi
> +		done
>  	done
>  
>  	for i in ${string[@]}; do
> @@ -88,6 +96,20 @@ lint_variable() {
>  
>  		for a in ${arch[@]}; do
>  			[[ $a == "any" ]] && continue
> +			
> +			for i in ${string[@]}; do
> +				if extract_function_variable "package_$pkg" "${i}_${a}" 0 out; then
> +					error "$(gettext "%s can not be architecture specific: $s_$s")" "$i"

Discussed on IRC, but for the record the $s_$s thing here needs fixed.

A


More information about the pacman-dev mailing list