[pacman-dev] [PATCH 1/1] lint_pkgbuild/pkgname: pkgname is not allowed to be empty
Christian Hesse
list at eworm.de
Tue Oct 4 08:21:11 UTC 2016
From: Christian Hesse <mail at eworm.de>
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 at eworm.de>
---
scripts/libmakepkg/lint_pkgbuild/pkgname.sh.in | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/scripts/libmakepkg/lint_pkgbuild/pkgname.sh.in b/scripts/libmakepkg/lint_pkgbuild/pkgname.sh.in
index a044082..2696afa 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[0]}" ]]; then
+ error "$(gettext "%s is not allowed to be empty.")" "pkgname"
+ ret=1
+ fi
+
for i in "${pkgname[@]}"; do
if [[ -z $i ]]; then
error "$(gettext "%s is not allowed to be empty.")" "pkgname"
--
2.10.0
More information about the pacman-dev
mailing list