public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 3/8] libstdc++: use grep -E instead of egrep in scripts
       [not found] <74ea0c62ebe19db186263053e4051f81d46e9da4.camel@xry111.site>
@ 2022-06-24  7:02 ` Xi Ruoyao
  2022-06-24 10:00   ` Jonathan Wakely
  0 siblings, 1 reply; 8+ messages in thread
From: Xi Ruoyao @ 2022-06-24  7:02 UTC (permalink / raw)
  To: gcc-patches; +Cc: libstdc++

egrep has been deprecated in favor of grep -E for a long time, and the
next grep release (3.8 or 4.0) will print a warning of egrep is used.
Stop using egrep so we won't see the warning.

libstdc++-v3/ChangeLog:

	* scripts/extract_symvers.in: Use grep -E instead of egrep.
	* libstdc++-v3/scripts/run_doxygen: Likewise.
---
 libstdc++-v3/scripts/extract_symvers.in | 4 ++--
 libstdc++-v3/scripts/run_doxygen        | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/libstdc++-v3/scripts/extract_symvers.in b/libstdc++-v3/scripts/extract_symvers.in
index dd9f63d4f16..d8ea62355ae 100755
--- a/libstdc++-v3/scripts/extract_symvers.in
+++ b/libstdc++-v3/scripts/extract_symvers.in
@@ -54,8 +54,8 @@ SunOS)
   ${readelf} ${lib} |\
   sed -e 's/ \[<other>: [A-Fa-f0-9]*\] //' -e '/\.dynsym/,/^$/p;d' |\
   sed -e 's/ \[<localentry>: [0-9]*\] //' |\
-  egrep -v ' (LOCAL|UND) ' |\
-  egrep -v ' (_DYNAMIC|_GLOBAL_OFFSET_TABLE_|_PROCEDURE_LINKAGE_TABLE_|_edata|_end|_etext)$' |\
+  grep -E -v ' (LOCAL|UND) ' |\
+  grep -E -v ' (_DYNAMIC|_GLOBAL_OFFSET_TABLE_|_PROCEDURE_LINKAGE_TABLE_|_edata|_end|_etext)$' |\
   sed -e 's/ <processor specific>: / <processor_specific>:_/g' |\
   sed -e 's/ <OS specific>: / <OS_specific>:_/g' |\
   sed -e 's/ <unknown>: / <unknown>:_/g' |\
diff --git a/libstdc++-v3/scripts/run_doxygen b/libstdc++-v3/scripts/run_doxygen
index 86da071d86c..50514c744c9 100644
--- a/libstdc++-v3/scripts/run_doxygen
+++ b/libstdc++-v3/scripts/run_doxygen
@@ -291,7 +291,7 @@ cxxflags="-Og -g -std=gnu++23"
 $gxx $cppflags $cxxflags ${srcdir}/doc/doxygen/stdheader.cc -o ./stdheader || exit 1
 # Doxygen outputs something like "\fC#include <unique_lock\&.h>\fP" and
 # we want that internal header to be replaced with something like <mutex>.
-problematic=`egrep -l '#include <.*h>' [a-z]*.3`
+problematic=`grep -E -l '#include <.*h>' [a-z]*.3`
 for f in $problematic; do
     # this is also slow, but safe and easy to debug
     oldh=`sed -n '/fC#include </s/.*<\(.*\)>.*/\1/p' $f`
@@ -303,7 +303,7 @@ rm stdheader
 # Some of the pages for generated modules have text that confuses certain
 # implementations of man(1), e.g. on GNU/Linux.  We need to have another
 # top-level *roff tag to /stop/ the .SH NAME entry.
-problematic=`egrep --files-without-match '^\.SH SYNOPSIS' [A-Z]*.3`
+problematic=`grep -E --files-without-match '^\.SH SYNOPSIS' [A-Z]*.3`
 #problematic='Containers.3 Sequences.3 Assoc_containers.3 Iterator_types.3'
 
 for f in $problematic; do
-- 
2.36.1



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

* Re: [PATCH 3/8] libstdc++: use grep -E instead of egrep in scripts
  2022-06-24  7:02 ` [PATCH 3/8] libstdc++: use grep -E instead of egrep in scripts Xi Ruoyao
@ 2022-06-24 10:00   ` Jonathan Wakely
  2022-06-24 11:08     ` Xi Ruoyao
  0 siblings, 1 reply; 8+ messages in thread
From: Jonathan Wakely @ 2022-06-24 10:00 UTC (permalink / raw)
  To: Xi Ruoyao; +Cc: gcc-patches, libstdc++

On Fri, 24 Jun 2022 at 08:03, Xi Ruoyao via Libstdc++
<libstdc++@gcc.gnu.org> wrote:
>
> egrep has been deprecated in favor of grep -E for a long time, and the
> next grep release (3.8 or 4.0) will print a warning of egrep is used.
> Stop using egrep so we won't see the warning.
>
> libstdc++-v3/ChangeLog:
>
>         * scripts/extract_symvers.in: Use grep -E instead of egrep.
>         * libstdc++-v3/scripts/run_doxygen: Likewise.

This should be just scripts/run_doxygen here. You can use the git
gcc-verify alias to check your changelog format.


With that fixed it's OK for trunk and gcc-12 and gcc-11 branches, thanks!

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

* Re: [PATCH 3/8] libstdc++: use grep -E instead of egrep in scripts
  2022-06-24 10:00   ` Jonathan Wakely
@ 2022-06-24 11:08     ` Xi Ruoyao
  2022-06-24 11:18       ` Jonathan Wakely
  0 siblings, 1 reply; 8+ messages in thread
From: Xi Ruoyao @ 2022-06-24 11:08 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: gcc-patches, libstdc++, Rainer Orth

On Fri, 2022-06-24 at 11:00 +0100, Jonathan Wakely wrote:
> On Fri, 24 Jun 2022 at 08:03, Xi Ruoyao via Libstdc++
> <libstdc++@gcc.gnu.org> wrote:
> > 
> > egrep has been deprecated in favor of grep -E for a long time, and
> > the
> > next grep release (3.8 or 4.0) will print a warning of egrep is
> > used.
> > Stop using egrep so we won't see the warning.
> > 
> > libstdc++-v3/ChangeLog:
> > 
> >         * scripts/extract_symvers.in: Use grep -E instead of egrep.
> >         * libstdc++-v3/scripts/run_doxygen: Likewise.
> 
> This should be just scripts/run_doxygen here. You can use the git
> gcc-verify alias to check your changelog format.
> 
> 
> With that fixed it's OK for trunk and gcc-12 and gcc-11 branches,
> thanks!

I'll need some rework as Rainer told me "grep -E" may not work on some
Solaris systems w/o GNU grep, and the code snippet in extract_symvers.in
is exactly for Solaris...

-- 
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University

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

* Re: [PATCH 3/8] libstdc++: use grep -E instead of egrep in scripts
  2022-06-24 11:08     ` Xi Ruoyao
@ 2022-06-24 11:18       ` Jonathan Wakely
  2022-06-24 11:35         ` Jonathan Wakely
  0 siblings, 1 reply; 8+ messages in thread
From: Jonathan Wakely @ 2022-06-24 11:18 UTC (permalink / raw)
  To: Xi Ruoyao; +Cc: Jonathan Wakely, libstdc++, gcc-patches, Rainer Orth

On Fri, 24 Jun 2022 at 12:08, Xi Ruoyao via Libstdc++
<libstdc++@gcc.gnu.org> wrote:
>
> On Fri, 2022-06-24 at 11:00 +0100, Jonathan Wakely wrote:
> > On Fri, 24 Jun 2022 at 08:03, Xi Ruoyao via Libstdc++
> > <libstdc++@gcc.gnu.org> wrote:
> > >
> > > egrep has been deprecated in favor of grep -E for a long time, and
> > > the
> > > next grep release (3.8 or 4.0) will print a warning of egrep is
> > > used.
> > > Stop using egrep so we won't see the warning.
> > >
> > > libstdc++-v3/ChangeLog:
> > >
> > >         * scripts/extract_symvers.in: Use grep -E instead of egrep.
> > >         * libstdc++-v3/scripts/run_doxygen: Likewise.
> >
> > This should be just scripts/run_doxygen here. You can use the git
> > gcc-verify alias to check your changelog format.
> >
> >
> > With that fixed it's OK for trunk and gcc-12 and gcc-11 branches,
> > thanks!
>
> I'll need some rework as Rainer told me "grep -E" may not work on some
> Solaris systems w/o GNU grep, and the code snippet in extract_symvers.in
> is exactly for Solaris...

I checked that, and it's not :-)

The egrep uses in extract_symvers.in are for everything *except*
SunOS. For Solaris we use the scripts/extract_symvers.pl script
instead.

Your change might break generation of Doxygen API docs on Solaris, but
maybe we can live with that.


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

* Re: [PATCH 3/8] libstdc++: use grep -E instead of egrep in scripts
  2022-06-24 11:18       ` Jonathan Wakely
@ 2022-06-24 11:35         ` Jonathan Wakely
  2022-06-24 11:41           ` Rainer Orth
  0 siblings, 1 reply; 8+ messages in thread
From: Jonathan Wakely @ 2022-06-24 11:35 UTC (permalink / raw)
  To: Xi Ruoyao; +Cc: Jonathan Wakely, libstdc++, gcc-patches, Rainer Orth

On Fri, 24 Jun 2022 at 12:18, Jonathan Wakely <jwakely@redhat.com> wrote:
>
> On Fri, 24 Jun 2022 at 12:08, Xi Ruoyao via Libstdc++
> <libstdc++@gcc.gnu.org> wrote:
> >
> > On Fri, 2022-06-24 at 11:00 +0100, Jonathan Wakely wrote:
> > > On Fri, 24 Jun 2022 at 08:03, Xi Ruoyao via Libstdc++
> > > <libstdc++@gcc.gnu.org> wrote:
> > > >
> > > > egrep has been deprecated in favor of grep -E for a long time, and
> > > > the
> > > > next grep release (3.8 or 4.0) will print a warning of egrep is
> > > > used.
> > > > Stop using egrep so we won't see the warning.
> > > >
> > > > libstdc++-v3/ChangeLog:
> > > >
> > > >         * scripts/extract_symvers.in: Use grep -E instead of egrep.
> > > >         * libstdc++-v3/scripts/run_doxygen: Likewise.
> > >
> > > This should be just scripts/run_doxygen here. You can use the git
> > > gcc-verify alias to check your changelog format.
> > >
> > >
> > > With that fixed it's OK for trunk and gcc-12 and gcc-11 branches,
> > > thanks!
> >
> > I'll need some rework as Rainer told me "grep -E" may not work on some
> > Solaris systems w/o GNU grep, and the code snippet in extract_symvers.in
> > is exactly for Solaris...
>
> I checked that, and it's not :-)
>
> The egrep uses in extract_symvers.in are for everything *except*
> SunOS. For Solaris we use the scripts/extract_symvers.pl script
> instead.
>
> Your change might break generation of Doxygen API docs on Solaris, but
> maybe we can live with that.

/usr/xpg4/bin/grep supports the -E flag, so I was going to say that
it's acceptable to require that version in the PATH when generating
the API docs with doxygen. But in fact that script already assumes GNU
grep anyway, using egrep --files-without-match and POSIX grep does not
support --files-without-match, or the short form of that option, -L.

And in fact, neither of the uses of egrep in scripts/run_doxygen
actually needs to use extended regular expressions. Plain ol' grep
with Basic Regular Expressions will work fine:

problematic=`egrep -l '#include <.*h>' [a-z]*.3`
problematic=`egrep --files-without-match '^\.SH SYNOPSIS' [A-Z]*.3`

There are no ERE special characters here, so itcould just use 'grep'
not 'egrep'. And it won't work with Solaris grep anyway.


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

* Re: [PATCH 3/8] libstdc++: use grep -E instead of egrep in scripts
  2022-06-24 11:35         ` Jonathan Wakely
@ 2022-06-24 11:41           ` Rainer Orth
  2022-06-24 12:37             ` Xi Ruoyao
  0 siblings, 1 reply; 8+ messages in thread
From: Rainer Orth @ 2022-06-24 11:41 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: Xi Ruoyao, Jonathan Wakely, libstdc++, gcc-patches

Hi Jonathan,

>> > I'll need some rework as Rainer told me "grep -E" may not work on some
>> > Solaris systems w/o GNU grep, and the code snippet in extract_symvers.in
>> > is exactly for Solaris...
>>
>> I checked that, and it's not :-)
>>
>> The egrep uses in extract_symvers.in are for everything *except*
>> SunOS. For Solaris we use the scripts/extract_symvers.pl script
>> instead.
>>
>> Your change might break generation of Doxygen API docs on Solaris, but
>> maybe we can live with that.
>
> /usr/xpg4/bin/grep supports the -E flag, so I was going to say that
> it's acceptable to require that version in the PATH when generating
> the API docs with doxygen. But in fact that script already assumes GNU

indeed: for a niche/developer-only use, the bar of tool requirements can
be higher IMO.  Besides, /usr/gnu/bin/grep is there, too (or could be;
both /usr/xpg4/bin/grep and /usr/gnu/bin/grep live in separate packages
that may or may not be installed).

I just want to make the entry barries for normal builds as low as
possible.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

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

* Re: [PATCH 3/8] libstdc++: use grep -E instead of egrep in scripts
  2022-06-24 11:41           ` Rainer Orth
@ 2022-06-24 12:37             ` Xi Ruoyao
  2022-06-24 12:38               ` Jonathan Wakely
  0 siblings, 1 reply; 8+ messages in thread
From: Xi Ruoyao @ 2022-06-24 12:37 UTC (permalink / raw)
  To: Rainer Orth, Jonathan Wakely; +Cc: Jonathan Wakely, libstdc++, gcc-patches

On Fri, 2022-06-24 at 13:41 +0200, Rainer Orth wrote:
> Hi Jonathan,
> 
> > > > I'll need some rework as Rainer told me "grep -E" may not work on some
> > > > Solaris systems w/o GNU grep, and the code snippet in extract_symvers.in
> > > > is exactly for Solaris...
> > > 
> > > I checked that, and it's not :-)
> > > 
> > > The egrep uses in extract_symvers.in are for everything *except*
> > > SunOS. For Solaris we use the scripts/extract_symvers.pl script
> > > instead.

I misread the case statement :(.

> > > Your change might break generation of Doxygen API docs on Solaris, but
> > > maybe we can live with that.
> > 
> > /usr/xpg4/bin/grep supports the -E flag, so I was going to say that
> > it's acceptable to require that version in the PATH when generating
> > the API docs with doxygen. But in fact that script already assumes GNU
> 
> indeed: for a niche/developer-only use, the bar of tool requirements can
> be higher IMO.  Besides, /usr/gnu/bin/grep is there, too (or could be;
> both /usr/xpg4/bin/grep and /usr/gnu/bin/grep live in separate packages
> that may or may not be installed).
> 
> I just want to make the entry barries for normal builds as low as
> possible.

Pushed as r13-1242 with ChangeLog fix, as compatibility-related stuff
"resolved" and this does not depend on other patches in the series.
-- 
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University

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

* Re: [PATCH 3/8] libstdc++: use grep -E instead of egrep in scripts
  2022-06-24 12:37             ` Xi Ruoyao
@ 2022-06-24 12:38               ` Jonathan Wakely
  0 siblings, 0 replies; 8+ messages in thread
From: Jonathan Wakely @ 2022-06-24 12:38 UTC (permalink / raw)
  To: Xi Ruoyao; +Cc: Rainer Orth, Jonathan Wakely, libstdc++, gcc-patches

On Fri, 24 Jun 2022 at 13:37, Xi Ruoyao <xry111@xry111.site> wrote:
>
> On Fri, 2022-06-24 at 13:41 +0200, Rainer Orth wrote:
> > Hi Jonathan,
> >
> > > > > I'll need some rework as Rainer told me "grep -E" may not work on some
> > > > > Solaris systems w/o GNU grep, and the code snippet in extract_symvers.in
> > > > > is exactly for Solaris...
> > > >
> > > > I checked that, and it's not :-)
> > > >
> > > > The egrep uses in extract_symvers.in are for everything *except*
> > > > SunOS. For Solaris we use the scripts/extract_symvers.pl script
> > > > instead.
>
> I misread the case statement :(.
>
> > > > Your change might break generation of Doxygen API docs on Solaris, but
> > > > maybe we can live with that.
> > >
> > > /usr/xpg4/bin/grep supports the -E flag, so I was going to say that
> > > it's acceptable to require that version in the PATH when generating
> > > the API docs with doxygen. But in fact that script already assumes GNU
> >
> > indeed: for a niche/developer-only use, the bar of tool requirements can
> > be higher IMO.  Besides, /usr/gnu/bin/grep is there, too (or could be;
> > both /usr/xpg4/bin/grep and /usr/gnu/bin/grep live in separate packages
> > that may or may not be installed).
> >
> > I just want to make the entry barries for normal builds as low as
> > possible.
>
> Pushed as r13-1242 with ChangeLog fix, as compatibility-related stuff
> "resolved" and this does not depend on other patches in the series.

Great, thanks!


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

end of thread, other threads:[~2022-06-24 12:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <74ea0c62ebe19db186263053e4051f81d46e9da4.camel@xry111.site>
2022-06-24  7:02 ` [PATCH 3/8] libstdc++: use grep -E instead of egrep in scripts Xi Ruoyao
2022-06-24 10:00   ` Jonathan Wakely
2022-06-24 11:08     ` Xi Ruoyao
2022-06-24 11:18       ` Jonathan Wakely
2022-06-24 11:35         ` Jonathan Wakely
2022-06-24 11:41           ` Rainer Orth
2022-06-24 12:37             ` Xi Ruoyao
2022-06-24 12:38               ` Jonathan Wakely

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).