[pacman-dev] [PATCH] makepkg: extend test for hyphen prefixes to pkgbase and all pkgnames

Cedric Staniewski cedric at gmx.ca
Mon Oct 26 08:21:43 EDT 2009


Since commit fb97d32, which brought in this test, support for split
PKGBUILDs was added, and therefore, all values of pkgname and also
pkgbase have to be checked now.

Signed-off-by: Cedric Staniewski <cedric at gmx.ca>
---

> So it does....  I glad someone refers to the documentation! 

:)

 scripts/makepkg.sh.in |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 9cd7f2e..4c05ccc 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1139,10 +1139,17 @@ check_sanity() {
 		error "$(gettext "%s is not allowed to be empty.")" "pkgrel"
 		return 1
 	fi
-	if [ "${pkgname:0:1}" == "-" ]; then
-		error "$(gettext "%s is not allowed to start with a hyphen.")" "pkgname"
+	if [[ ${pkgbase:0:1} = "-" ]]; then
+		error "$(gettext "%s is not allowed to start with a hyphen.")" "pkgbase"
 		return 1
 	fi
+	local name
+	for name in "${pkgname[@]}"; do
+		if [[ ${name:0:1} = "-" ]]; then
+			error "$(gettext "%s is not allowed to start with a hyphen.")" "pkgname"
+			return 1
+		fi
+	done
 	if [ "$pkgver" != "${pkgver//-/}" ]; then
 		error "$(gettext "%s is not allowed to contain hyphens.")" "pkgver"
 		return 1
-- 
1.6.5.1



More information about the pacman-dev mailing list