summaryrefslogtreecommitdiffstats
path: root/scripts/libmakepkg/lint_pkgbuild/pkgname.sh.in
diff options
context:
space:
mode:
authorChristian Hesse <mail@eworm.de>2016-10-04 10:21:11 +0200
committerAllan McRae <allan@archlinux.org>2016-10-10 02:38:05 +0200
commite2b4e220bcb6d3770716fb000953aa729ed07989 (patch)
tree0e912f55b2ade0de43b6715948fe00a020bca627 /scripts/libmakepkg/lint_pkgbuild/pkgname.sh.in
parent0c99eabd50752310f42ec808c8734a338122ec86 (diff)
downloadpacman-e2b4e220bcb6d3770716fb000953aa729ed07989.tar.gz
pacman-e2b4e220bcb6d3770716fb000953aa729ed07989.tar.xz
lint_pkgbuild/pkgname: pkgname is not allowed to be empty
We checked for empty array elements, but did not catch empty array. Add a check for that case as well. Signed-off-by: Christian Hesse <mail@eworm.de> Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'scripts/libmakepkg/lint_pkgbuild/pkgname.sh.in')
-rw-r--r--scripts/libmakepkg/lint_pkgbuild/pkgname.sh.in5
1 files changed, 5 insertions, 0 deletions
diff --git a/scripts/libmakepkg/lint_pkgbuild/pkgname.sh.in b/scripts/libmakepkg/lint_pkgbuild/pkgname.sh.in
index a0440827..1a1a5b12 100644
--- a/scripts/libmakepkg/lint_pkgbuild/pkgname.sh.in
+++ b/scripts/libmakepkg/lint_pkgbuild/pkgname.sh.in
@@ -32,6 +32,11 @@ lint_pkgbuild_functions+=('lint_pkgname')
lint_pkgname() {
local ret=0 i
+ if [[ -z ${pkgname[@]} ]]; then
+ error "$(gettext "%s is not allowed to be empty.")" "pkgname"
+ return 1
+ fi
+
for i in "${pkgname[@]}"; do
if [[ -z $i ]]; then
error "$(gettext "%s is not allowed to be empty.")" "pkgname"