From a28868eeae98b28c00f8112e8d81403ad21a3117 Mon Sep 17 00:00:00 2001
From: Allan McRae <allan@archlinux.org>
Date: Thu, 5 Aug 2010 21:37:22 +1000
Subject: makepkg: error out on empty optdepends entries

If optdepends was defined with empty members, then makepkg would
abort late in the package building process.  Detect such cases
in the check_sanity() function.

Fix-provided-by: Andres P <aepd87@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
---
 scripts/makepkg.sh.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'scripts')

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index eb3bd86d..272c3292 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1233,7 +1233,7 @@ check_sanity() {
 
 	for i in "${optdepends[@]}"; do
 		local pkg=${i%%:*}
-		if [[ ! $pkg =~ ^[[:alnum:]\>\<\=\.\+\_\-]*$ ]]; then
+		if [[ ! $pkg =~ ^[[:alnum:]\>\<\=\.\+\_\-]+$ ]]; then
 			error "$(gettext "Invalid syntax for optdepend : '%s'")" "$i"
 		fi
 	done
-- 
cgit v1.2.3-2-g168b