makepkg: lint empty arrays
While depend arrays are already linted, many array kinds are still not. An empty string is never a valid array value so check all arrays for it.
This commit is contained in:
parent
2348dcab22
commit
e83e53f3f9
1 changed files with 19 additions and 1 deletions
|
@ -28,7 +28,7 @@ source "$LIBRARY/util/pkgbuild.sh"
|
||||||
source "$LIBRARY/util/schema.sh"
|
source "$LIBRARY/util/schema.sh"
|
||||||
|
|
||||||
lint_pkgbuild_functions+=('lint_variable')
|
lint_pkgbuild_functions+=('lint_variable')
|
||||||
|
lint_pkgbuild_functions+=('lint_array')
|
||||||
|
|
||||||
lint_variable() {
|
lint_variable() {
|
||||||
local i a pkg out bad ret=0
|
local i a pkg out bad ret=0
|
||||||
|
@ -95,3 +95,21 @@ lint_variable() {
|
||||||
|
|
||||||
return $ret
|
return $ret
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lint_array() {
|
||||||
|
local i var ret=0
|
||||||
|
|
||||||
|
for i in ${pkgbuild_schema_arrays[@]}; do
|
||||||
|
local l=()
|
||||||
|
get_pkgbuild_all_split_attributes $i l
|
||||||
|
|
||||||
|
for var in "${l[@]}"; do
|
||||||
|
if [[ -z $var ]]; then
|
||||||
|
error "$(gettext "%s does not allow empty values.")" "$i"
|
||||||
|
ret=1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
|
|
||||||
|
return $ret
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue