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

morganamilo morganamilo at gmail.com
Tue Jan 15 22:34:10 UTC 2019


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"
+					ret=1
+				fi
+			done
+
+			for i in ${array[@]}; do
+				if extract_function_variable "package_$pkg" "${i}_${a}" 1 out; then
+					error "$(gettext "%s can not be architecture specific: $s_$s")" "$i"
+					ret=1
+				fi
+			done
 
 			for i in ${no_package_string[@]}; do
 				if extract_function_variable "package_$pkg" "${i}_${a}" 0 out; then
-- 
2.20.1


More information about the pacman-dev mailing list