From 0845b2f13cef6db23a4a281976ec1374e93b7c4e Mon Sep 17 00:00:00 2001 From: Xavier Chantry Date: Sun, 30 Aug 2009 22:05:46 +0200 Subject: sanity check for optdepends syntax only allow optdepends like: pkgname: description some (real) examples of invalid optdepends: 'tcl, python and/or ruby: to use corresponding binding' 'xorg-fonts-75dpi : X bitmap fonts needed for the interface' 'ruby-htmlentities (AUR): for one provider named Deastore' 'xpdf - for pdf' Signed-off-by: Xavier Chantry [Allan: rebase off de39a1f6 and adjust man page] Signed-off-by: Allan McRae Signed-off-by: Dan McGee --- scripts/makepkg.sh.in | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'scripts/makepkg.sh.in') diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 558f0938..3e918e69 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -1180,6 +1180,14 @@ check_sanity() { fi done + local optdepend + for optdepend in "${optdepends[@]}"; do + pkg=${optdepend%%:*} + if [[ ! $pkg =~ ^[[:alnum:]\>\<\=\.\+\_\-]*$ ]]; then + error "$(gettext "Invalid syntax for optdepend : '%s'")" "$optdepend" + fi + done + if [ "$install" -a ! -f "$install" ]; then error "$(gettext "Install scriptlet (%s) does not exist.")" "$install" return 1 -- cgit v1.2.3-70-g09d2