public inbox for crossgcc@sourceware.org
 help / color / mirror / Atom feed
* Re: [PATCH] [RESEND] scripts/crosstool-NG.sh.in: patch regex to work with BSD grep
@ 2014-10-16 16:57 Jason T. Masker
  2014-10-16 18:29 ` Jason T. Masker
  0 siblings, 1 reply; 4+ messages in thread
From: Jason T. Masker @ 2014-10-16 16:57 UTC (permalink / raw)
  To: crossgcc

Resending with sign off. Apologies.

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 Masker <jason@masker.net>


diff --git a/kconfig/kconfig.mk b/kconfig/kconfig.mk
index cb9f91c..06e022c 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;                                                         \
diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in
index cd65d5b..53ac552 100644
--- a/scripts/crosstool-NG.sh.in
+++ b/scripts/crosstool-NG.sh.in
@@ -125,7 +125,7 @@ CT_DoLog INFO "Build started ${CT_STAR_DATE_HUMAN}"
 # We really need to extract from ,config and not .config.2, as we
 # do want the kconfig's values, not our mangled config with arrays.
 CT_DoStep DEBUG "Dumping user-supplied crosstool-NG configuration"
-CT_DoExecLog DEBUG ${grep} -E '^(# |)CT_' .config
+CT_DoExecLog DEBUG ${grep} -E '^(# )?CT_' .config
 CT_EndStep

 CT_DoLog DEBUG "Unsetting and unexporting MAKEFLAGS"

--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] [RESEND] scripts/crosstool-NG.sh.in: patch regex to work with BSD grep
  2014-10-16 16:57 [PATCH] [RESEND] scripts/crosstool-NG.sh.in: patch regex to work with BSD grep Jason T. Masker
@ 2014-10-16 18:29 ` Jason T. Masker
  0 siblings, 0 replies; 4+ messages in thread
From: Jason T. Masker @ 2014-10-16 18:29 UTC (permalink / raw)
  To: crossgcc

Patch to make regex BSD grep compatible. Updated to fix formatting
error in patch.

Signed-off-by: Jason Masker <jason@masker.net>


diff --git a/kconfig/kconfig.mk b/kconfig/kconfig.mk
index cb9f91c..06e022c 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;                                                         \
diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in
index cd65d5b..53ac552 100644
--- a/scripts/crosstool-NG.sh.in
+++ b/scripts/crosstool-NG.sh.in
@@ -125,7 +125,7 @@ CT_DoLog INFO "Build started ${CT_STAR_DATE_HUMAN}"
 # We really need to extract from ,config and not .config.2, as we
 # do want the kconfig's values, not our mangled config with arrays.
 CT_DoStep DEBUG "Dumping user-supplied crosstool-NG configuration"
-CT_DoExecLog DEBUG ${grep} -E '^(# |)CT_' .config
+CT_DoExecLog DEBUG ${grep} -E '^(# )?CT_' .config
 CT_EndStep

 CT_DoLog DEBUG "Unsetting and unexporting MAKEFLAGS"

--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] [RESEND] scripts/crosstool-NG.sh.in: patch regex to work with BSD grep
  2014-10-16 18:54 Jason Masker
@ 2014-10-16 19:01 ` Bryan Hundven
  0 siblings, 0 replies; 4+ messages in thread
From: Bryan Hundven @ 2014-10-16 19:01 UTC (permalink / raw)
  To: Jason Masker; +Cc: crossgcc maillist, Yann E. MORIN

Jason,

On Thu, Oct 16, 2014 at 11:54 AM, Jason Masker <jason@masker.net> wrote:
> Patch to make regex BSD grep compatible. Final resend before giving up. Mail client keeps stripping tabs.
>
> Signed-off-by: Jason Masker <jason@masker.net>
>
>
> diff --git a/kconfig/kconfig.mk b/kconfig/kconfig.mk
> index cb9f91c..06e022c 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;                                                         \
> diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in
> index cd65d5b..53ac552 100644
> --- a/scripts/crosstool-NG.sh.in
> +++ b/scripts/crosstool-NG.sh.in
> @@ -125,7 +125,7 @@ CT_DoLog INFO "Build started ${CT_STAR_DATE_HUMAN}"
>  # We really need to extract from ,config and not .config.2, as we
>  # do want the kconfig's values, not our mangled config with arrays.
>  CT_DoStep DEBUG "Dumping user-supplied crosstool-NG configuration"
> -CT_DoExecLog DEBUG ${grep} -E '^(# |)CT_' .config
> +CT_DoExecLog DEBUG ${grep} -E '^(# )?CT_' .config
>  CT_EndStep
>
>  CT_DoLog DEBUG "Unsetting and unexporting MAKEFLAGS"
> --
> For unsubscribe information see http://sourceware.org/lists.html#faq
>

Tip #1: Make sure that you email yann as well as crossgcc mailing list

have you tried using 'git send-email' ?

I usually run it like this: git send-email -<number of patches from
HEAD to send> --to '"Yann E. MORIN" <yann.morin.1998@free.fr>' --cc
"crossgcc@sourceware.org"

You have to have some things setup in your .gitconfig first, and you
can find help with that here:
http://git-scm.com/docs/git-send-email

-Bryan

--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] [RESEND] scripts/crosstool-NG.sh.in: patch regex to work with BSD grep
@ 2014-10-16 18:54 Jason Masker
  2014-10-16 19:01 ` Bryan Hundven
  0 siblings, 1 reply; 4+ messages in thread
From: Jason Masker @ 2014-10-16 18:54 UTC (permalink / raw)
  To: crossgcc

Patch to make regex BSD grep compatible. Final resend before giving up. Mail client keeps stripping tabs.

Signed-off-by: Jason Masker <jason@masker.net>


diff --git a/kconfig/kconfig.mk b/kconfig/kconfig.mk
index cb9f91c..06e022c 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;                                                         \
diff --git a/scripts/crosstool-NG.sh.in b/scripts/crosstool-NG.sh.in
index cd65d5b..53ac552 100644
--- a/scripts/crosstool-NG.sh.in
+++ b/scripts/crosstool-NG.sh.in
@@ -125,7 +125,7 @@ CT_DoLog INFO "Build started ${CT_STAR_DATE_HUMAN}"
 # We really need to extract from ,config and not .config.2, as we
 # do want the kconfig's values, not our mangled config with arrays.
 CT_DoStep DEBUG "Dumping user-supplied crosstool-NG configuration"
-CT_DoExecLog DEBUG ${grep} -E '^(# |)CT_' .config
+CT_DoExecLog DEBUG ${grep} -E '^(# )?CT_' .config
 CT_EndStep
 
 CT_DoLog DEBUG "Unsetting and unexporting MAKEFLAGS"
--
For unsubscribe information see http://sourceware.org/lists.html#faq

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-10-16 19:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-16 16:57 [PATCH] [RESEND] scripts/crosstool-NG.sh.in: patch regex to work with BSD grep Jason T. Masker
2014-10-16 18:29 ` Jason T. Masker
2014-10-16 18:54 Jason Masker
2014-10-16 19:01 ` Bryan Hundven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).