Using >= in the provides array is stupid so make it cause an error.
Fixes FS#12540.

Also, use bash substitution rather than spawning new processes where
possible in the error checking.  Move split package detection to a
better position.

Signed-off-by: Allan McRae <[email protected]>
---
 scripts/makepkg.sh.in |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 66aaa5e..634ee4e 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1574,6 +1574,10 @@ if [ "$GENINTEG" = "1" ]; then
        exit 0 # $E_OK
 fi
 
+if [ "${#pkgna...@]}" -gt "1" ]; then
+       SPLITPKG=1
+fi
+
 # check for no-no's in the build script
 if [ -z "$pkgname" ]; then
        error "$(gettext "%s is not allowed to be empty.")" "pkgname"
@@ -1587,19 +1591,15 @@ if [ -z "$pkgrel" ]; then
        error "$(gettext "%s is not allowed to be empty.")" "pkgrel"
        exit 1
 fi
-if [ $(echo "$pkgver" | grep '-') ]; then
+if [ $pkgver != ${pkgver//-/} ]; then
        error "$(gettext "%s is not allowed to contain hyphens.")" "pkgver"
        exit 1
 fi
-if [ $(echo "$pkgrel" | grep '-') ]; then
+if [ $pkgrel != ${pkgrel//-/} ]; then
        error "$(gettext "%s is not allowed to contain hyphens.")" "pkgrel"
        exit 1
 fi
 
-if [ "${#pkgna...@]}" -gt "1" ]; then
-       SPLITPKG=1
-fi
-
 if [ "$arch" = 'any' ]; then
        CARCH='any'
 fi
@@ -1613,6 +1613,10 @@ if ! in_array $CARCH ${ar...@]}; then
        fi
 fi
 
+if [ $(echo "${provid...@]" | grep ">=") ]; then
+       error "$(gettext "%s is not allowed to contain >= provisions.")" 
"provides"
+fi
+
 if [ "$install" -a ! -f "$install" ]; then
        error "$(gettext "Install scriptlet (%s) does not exist.")" "$install"
        exit 1
-- 
1.6.1

_______________________________________________
pacman-dev mailing list
[email protected]
http://archlinux.org/mailman/listinfo/pacman-dev

Reply via email to