[pacman-dev] Check variables for array

Alexpux alexpux at gmail.com
Thu Nov 5 05:25:59 UTC 2015


Hi all!
Checking variables in PKGBUILD with grep cause troubles. For example, if we have configure option like «—with-arch=…» grep give us false positive result and makepkg exit with error that «arch should be an array».
This is due next code in pacman/scripts/libmakepkg/lint_pkgbuild/variable.sh.in:

local array=(arch backup checkdepends groups license noextract options
	             validpgpkeys)
local arch_array=(conflicts depends makedepends md5sums optdepends provides
                  replaces sha1sums sha256sums sha384sums sha512sums source)
local string=(changelog epoch install pkgdesc pkgrel pkgver url)

local i
for i in ${array[@]}; do
	if grep -w -q -e "$i=[^(]" -e "$i+=[^(]" "$BUILDSCRIPT"; then
		error "$(gettext "%s should be an array")" "$i"
		ret=1
	fi
done

Regards,
Alexey.


More information about the pacman-dev mailing list