makepkg: allow versioned optdepends with epoch

Allow the specification of versioned optdepends with an epoch.
This also (partially) enforces a whitespace between ":" and the
description which is required for the future optdepends parsing
code.

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Allan McRae 2011-09-24 14:53:20 +10:00 committed by Dan McGee
parent d26d50e664
commit 6adf502f0d
1 changed files with 2 additions and 2 deletions

View File

@ -1529,8 +1529,8 @@ check_sanity() {
eval $(awk '/^[[:space:]]*optdepends=\(/,/\)[[:space:]]*(#.*)?$/' "$BUILDFILE" | \
sed -e "s/optdepends=/optdepends_list+=/" -e "s/#.*//" -e 's/\\$//')
for i in "${optdepends_list[@]}"; do
local pkg=${i%%:*}
if [[ $pkg != +([[:alnum:]><=.+_-]) ]]; then
local pkg=${i%%:[[:space:]]*}
if [[ $pkg != +([[:alnum:]><=.+_-:]) ]]; then
error "$(gettext "Invalid syntax for %s : '%s'")" "optdepend" "$i"
ret=1
fi