diff options
author | Jason T. Masker <jason@masker.net> | 2014-10-21 19:20:22 +0200 |
---|---|---|
committer | Bryan Hundven <bryanhundven@gmail.com> | 2014-12-05 03:12:57 -0800 |
commit | 10e157979915655d7030797bc09add644957aadb (patch) | |
tree | 0ffdee1da126e275abf15c68ae2360246efca837 /kconfig | |
parent | 60b5bc4c3ec5505edccbbfb03d5bdfae66be0054 (diff) | |
download | crosstool-ng-10e157979915655d7030797bc09add644957aadb.tar.gz crosstool-ng-10e157979915655d7030797bc09add644957aadb.tar.bz2 crosstool-ng-10e157979915655d7030797bc09add644957aadb.zip |
scripts/crosstool-NG.sh.in: patch regex to work with BSD grep
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
...
Signed-off-by: Jason T. Masker <jason@masker.net>
Tested-by: Andreas Bießmann <andreas@biessmann.de>
Signed-off-by: Bryan Hundven <bryanhundven@gmail.com>
Diffstat (limited to 'kconfig')
-rw-r--r-- | kconfig/kconfig.mk | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kconfig/kconfig.mk b/kconfig/kconfig.mk index cb9f91c0..06e022c1 100644 --- a/kconfig/kconfig.mk +++ b/kconfig/kconfig.mk @@ -38,7 +38,7 @@ defconfig: # Always be silent, the stdout an be >.config extractconfig: @$(awk) 'BEGIN { dump=0; } \ - dump==1 && $$0~/^\[.....\][[:space:]]+(# |)CT_/ { \ + dump==1 && $$0~/^\[.....\][[:space:]]+(# )?CT_/ { \ $$1=""; \ gsub("^[[:space:]]",""); \ print; \ |