summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2009-01-02 04:07:13 +1000
committerDan McGee <dan@archlinux.org>2009-01-02 22:46:47 -0600
commit2f59996c54da473294de4adf44d521299a045a84 (patch)
tree5d7789f02e885afda7213085f8d9c2e918f3643f /scripts
parentf4651c49af94164f2c129ea6eb3d78b86be4d5bc (diff)
downloadpacman-2f59996c54da473294de4adf44d521299a045a84.tar.xz
makepkg: detect incorrect usage of provides array
Using > or < in the provides array is wrong 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 <allan@archlinux.org> [Dan: backport to maint] Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/makepkg.sh.in12
1 files changed, 10 insertions, 2 deletions
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index b18665c5..04d2aca1 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1439,11 +1439,11 @@ 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
@@ -1465,6 +1465,14 @@ if ! in_array $CARCH ${arch[@]}; then
fi
fi
+for provide in ${provides[@]}; do
+ if [ $provide != ${provide//</} -o $provide != ${provide//>/} ]; then
+ error "$(gettext "Provides array cannot contain comparison (< or >) operators.")"
+ exit 1
+ fi
+done
+unset provide
+
if [ "$install" -a ! -f "$install" ]; then
error "$(gettext "Install scriptlet (%s) does not exist.")" "$install"
exit 1