[pacman-dev] [PATCH 1/7] libmakepkg: disallow empty arch

morganamilo morganamilo at gmail.com
Fri Jun 8 18:18:53 UTC 2018


We already ensure arch is an array but if arch is never defined
this error never triggers. Add an explicit check for a missing arch.

Signed-off-by: morganamilo <morganamilo at gmail.com>
---
 scripts/libmakepkg/lint_pkgbuild/arch.sh.in | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/scripts/libmakepkg/lint_pkgbuild/arch.sh.in b/scripts/libmakepkg/lint_pkgbuild/arch.sh.in
index ef1aac46..f2c80c73 100644
--- a/scripts/libmakepkg/lint_pkgbuild/arch.sh.in
+++ b/scripts/libmakepkg/lint_pkgbuild/arch.sh.in
@@ -33,6 +33,11 @@ lint_pkgbuild_functions+=('lint_arch')
 lint_arch() {
 	local a name list ret=0
 
+	if [[ -z $arch ]]; then
+		error "$(gettext "%s is not allowed to be empty.")" "arch"
+		return 1
+	fi
+
 	if [[ $arch == 'any' ]]; then
 		return 0
 	fi
-- 
2.17.1


More information about the pacman-dev mailing list