[Toybox] [PATCH 2/2] macOS: use -E rather than -r for sed extended regular expressions.

Rob Landley rob at landley.net
Wed Nov 28 14:45:45 PST 2018


On 11/28/18 2:16 PM, enh via Toybox wrote:
> GNU sed supports -E, -r, and --regexp-extended. BSD sed only supports
> -r.
> ---
>  scripts/genconfig.sh | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/scripts/genconfig.sh b/scripts/genconfig.sh
> index 533df60..3887b07 100755
> --- a/scripts/genconfig.sh
> +++ b/scripts/genconfig.sh
> @@ -144,7 +144,7 @@ genconfig > generated/Config.in || rm generated/Config.in
>  toys()
>  {
>    grep 'TOY(.*)' "$@" | grep -v TOYFLAG_NOFORK | grep -v "0))" | \
> -    sed -rn 's/([^:]*):.*(OLD|NEW)TOY\( *([a-zA-Z][^,]*) *,.*/\1:\3/p'
> +    sed -En 's/([^:]*):.*(OLD|NEW)TOY\( *([a-zA-Z][^,]*) *,.*/\1:\3/p'
>  }

Applied, but this raises the question of whether $SED in make.sh is still
needed? (I applied a patch from a macos dev who said it worked, I had a mac but
my apple store subscription was so screwed up an hour from a mac expert who knew
where the secret hidden error logs were couldn't get it unborked. I break
everything. Anyway, there patch used "gsed" instead of "sed", which is gnu sed.
The above wasn't using that because I forgot. :)

If we don't need gsed, then $SED should probably be removed...

Rob



More information about the Toybox mailing list