scripts/crosstool-NG.sh.in: patch regex to work with BSD grep

Jason T. Masker masker@post.harvard.edu
Tue Oct 14 06:44:00 GMT 2014


BSD grep does not interpret a null alteration. It complains about an
empty sub-expression, e.g.:

$ grep --version && grep -E '^(# |)CT_' .config
grep (BSD grep) 2.5.1-FreeBSD
grep: empty (sub)expression

This patch replaces the null alteration with a zero or once quantifier
which works with both BSD & GNU grep.

$ grep --version && grep -E '^(# )?CT_' .config
grep (BSD grep) 2.5.1-FreeBSD
CT_CONFIGURE_has_xz=y
CT_CONFIGURE_has_svn=y
...
$ ggrep --version && ggrep -E '^(# )?CT_' .config
ggrep (GNU grep) 2.20
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and others, see
<http://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>.
CT_CONFIGURE_has_xz=y
CT_CONFIGURE_has_svn=y
...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: crosstool-NG.sh.in-bsd-regex.patch
Type: application/octet-stream
Size: 611 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/crossgcc/attachments/20141014/4194dcb1/attachment.obj>
-------------- next part --------------
--
For unsubscribe information see http://sourceware.org/lists.html#faq


More information about the crossgcc mailing list