[pacman-dev] [PATCH 4/3] makepkg: fix a GNU-ism in awk usage
Dan McGee
dpmcgee at gmail.com
Sat Apr 2 14:13:11 EDT 2011
On Sat, Apr 2, 2011 at 5:31 AM, Rémy Oudompheng
<remyoudompheng at gmail.com> wrote:
> 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 <remy at archlinux.org>
> ---
> Problem arises when trying to use makepkg with FreeBSD's awk.
I'll let Allan take a look at this and sign off, eval and awk scare me
too much. :)
>
> 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
>
>
>
More information about the pacman-dev
mailing list