diff mbox

[pacman-dev] libmakepkg/lint_pkgbuild: squelch syntax error when a pkgname is empty

Message ID 20180601003124.18806-1-eschwartz@archlinux.org
State Accepted, archived
Headers show

Commit Message

Eli Schwartz June 1, 2018, 12:31 a.m. UTC
We fail with an error, but then we also fail with:

==> ERROR: depends is not allowed to be empty.
/usr/share/makepkg/lint_pkgbuild/pkgname.sh: line 39: continue: only meaningful in a `for', `while', or `until' loop

During the refactor to provide enhanced pkgname=pkgver linting, this was
moved out of the ${pkgname[@]} loop to a distinct function, at which
time it should have been modified to return rather than continue.

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
 scripts/libmakepkg/lint_pkgbuild/pkgname.sh.in | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox


diff --git a/scripts/libmakepkg/lint_pkgbuild/pkgname.sh.in b/scripts/libmakepkg/lint_pkgbuild/pkgname.sh.in
index d51c6313..84666a29 100644
--- a/scripts/libmakepkg/lint_pkgbuild/pkgname.sh.in
+++ b/scripts/libmakepkg/lint_pkgbuild/pkgname.sh.in
@@ -35,8 +35,7 @@  lint_one_pkgname() {
 	if [[ -z $name ]]; then
 		error "$(gettext "%s is not allowed to be empty.")" "$type"
-		ret=1
-		continue
+		return 1
 	if [[ ${name:0:1} = "-" ]]; then
 		error "$(gettext "%s is not allowed to start with a hyphen.")" "$type"