A non-GNU version of awk may not support the (|...) syntax for
an optional group and require '()' to match an empty string.
The (...)? syntax is more appropriate for this usage.

Signed-off-by: Rémy Oudompheng <[email protected]>
---
Problem arises when trying to use makepkg with FreeBSD's awk.

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

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 193a185..6d78887 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1275,7 +1275,7 @@ check_sanity() {
        done
 
        local optdepends_list=()
-       eval $(awk '/^[[:space:]]*optdepends=\(/,/\)[[:space:]]*(|#.*)$/' 
"$BUILDFILE" | \
+       eval $(awk '/^[[:space:]]*optdepends=\(/,/\)[[:space:]]*(#.*)?$/' 
"$BUILDFILE" | \
                sed -e "s/optdepends=/optdepends_list+=/" -e "s/#.*//")
        for i in "${optdepends_list[@]}"; do
                local pkg=${i%%:*}
-- 
1.7.4.2


Reply via email to