All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] common/rc: replace obsolescent egrep and fgrep
@ 2022-09-13  9:33 Zorro Lang
  2022-09-13 12:27 ` David Disseldorp
  2022-09-14 17:57 ` Darrick J. Wong
  0 siblings, 2 replies; 5+ messages in thread
From: Zorro Lang @ 2022-09-13  9:33 UTC (permalink / raw)
  To: fstests

Due to the change in grep project:
  a95156247098 ("egrep, fgrep: now obsolete")

some tests start to fail on latest Fedora system with grep-3.8-1.fc38
or newer version, as:

  generic/447 70s ... egrep: warning: egrep is obsolescent; using grep -E
  ...
      @@ -1,4 +1,5 @@
       QA output created by 447
      +egrep: warning: egrep is obsolescent; using grep -E
      ...

So use grep -E and -F to instead of egrep and fgrep commands.

Signed-off-by: Zorro Lang <zlang@kernel.org>
---
 common/rc | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/common/rc b/common/rc
index a25cbcd0..dee3965e 100644
--- a/common/rc
+++ b/common/rc
@@ -30,6 +30,17 @@ dd()
 	fi
 }
 
+# The egrep and fgrep are obsolescent
+egrep()
+{
+	grep -E "$@"
+}
+
+fgrep()
+{
+	grep -F "$@"
+}
+
 # Prints the md5 checksum of a given file
 _md5_checksum()
 {
-- 
2.31.1


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

* Re: [PATCH] common/rc: replace obsolescent egrep and fgrep
  2022-09-13  9:33 [PATCH] common/rc: replace obsolescent egrep and fgrep Zorro Lang
@ 2022-09-13 12:27 ` David Disseldorp
  2022-09-13 12:52   ` Zorro Lang
  2022-09-14 17:57 ` Darrick J. Wong
  1 sibling, 1 reply; 5+ messages in thread
From: David Disseldorp @ 2022-09-13 12:27 UTC (permalink / raw)
  To: Zorro Lang; +Cc: fstests

On Tue, 13 Sep 2022 17:33:45 +0800, Zorro Lang wrote:

> Due to the change in grep project:
>   a95156247098 ("egrep, fgrep: now obsolete")
> 
> some tests start to fail on latest Fedora system with grep-3.8-1.fc38
> or newer version, as:
> 
>   generic/447 70s ... egrep: warning: egrep is obsolescent; using grep -E
>   ...
>       @@ -1,4 +1,5 @@
>        QA output created by 447
>       +egrep: warning: egrep is obsolescent; using grep -E
>       ...
> 
> So use grep -E and -F to instead of egrep and fgrep commands.
> 
> Signed-off-by: Zorro Lang <zlang@kernel.org>
> ---
>  common/rc | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/common/rc b/common/rc
> index a25cbcd0..dee3965e 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -30,6 +30,17 @@ dd()
>  	fi
>  }
>  
> +# The egrep and fgrep are obsolescent
> +egrep()
> +{
> +	grep -E "$@"
> +}
> +
> +fgrep()
> +{
> +	grep -F "$@"
> +}
> +
>  # Prints the md5 checksum of a given file
>  _md5_checksum()
>  {

Nit: AFAICT there's only one fgrep caller, so just change that single
case. With that fixed:

Reviewed-by: David Disseldorp <ddiss@suse.de>

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

* Re: [PATCH] common/rc: replace obsolescent egrep and fgrep
  2022-09-13 12:27 ` David Disseldorp
@ 2022-09-13 12:52   ` Zorro Lang
  0 siblings, 0 replies; 5+ messages in thread
From: Zorro Lang @ 2022-09-13 12:52 UTC (permalink / raw)
  To: David Disseldorp; +Cc: fstests

On Tue, Sep 13, 2022 at 02:27:51PM +0200, David Disseldorp wrote:
> On Tue, 13 Sep 2022 17:33:45 +0800, Zorro Lang wrote:
> 
> > Due to the change in grep project:
> >   a95156247098 ("egrep, fgrep: now obsolete")
> > 
> > some tests start to fail on latest Fedora system with grep-3.8-1.fc38
> > or newer version, as:
> > 
> >   generic/447 70s ... egrep: warning: egrep is obsolescent; using grep -E
> >   ...
> >       @@ -1,4 +1,5 @@
> >        QA output created by 447
> >       +egrep: warning: egrep is obsolescent; using grep -E
> >       ...
> > 
> > So use grep -E and -F to instead of egrep and fgrep commands.
> > 
> > Signed-off-by: Zorro Lang <zlang@kernel.org>
> > ---
> >  common/rc | 11 +++++++++++
> >  1 file changed, 11 insertions(+)
> > 
> > diff --git a/common/rc b/common/rc
> > index a25cbcd0..dee3965e 100644
> > --- a/common/rc
> > +++ b/common/rc
> > @@ -30,6 +30,17 @@ dd()
> >  	fi
> >  }
> >  
> > +# The egrep and fgrep are obsolescent
> > +egrep()
> > +{
> > +	grep -E "$@"
> > +}
> > +
> > +fgrep()
> > +{
> > +	grep -F "$@"
> > +}
> > +
> >  # Prints the md5 checksum of a given file
> >  _md5_checksum()
> >  {
> 
> Nit: AFAICT there's only one fgrep caller, so just change that single
> case. With that fixed:

Thanks for reviewing!

Yeah, I thought about that too. But then I thought a fgrep() might help later
patches to avoid using fgrep command directly, so ...

Thanks,
Zorro

> 
> Reviewed-by: David Disseldorp <ddiss@suse.de>
> 

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

* Re: [PATCH] common/rc: replace obsolescent egrep and fgrep
  2022-09-13  9:33 [PATCH] common/rc: replace obsolescent egrep and fgrep Zorro Lang
  2022-09-13 12:27 ` David Disseldorp
@ 2022-09-14 17:57 ` Darrick J. Wong
  2022-09-15  3:39   ` Zorro Lang
  1 sibling, 1 reply; 5+ messages in thread
From: Darrick J. Wong @ 2022-09-14 17:57 UTC (permalink / raw)
  To: Zorro Lang; +Cc: fstests

On Tue, Sep 13, 2022 at 05:33:45PM +0800, Zorro Lang wrote:
> Due to the change in grep project:
>   a95156247098 ("egrep, fgrep: now obsolete")
> 
> some tests start to fail on latest Fedora system with grep-3.8-1.fc38
> or newer version, as:
> 
>   generic/447 70s ... egrep: warning: egrep is obsolescent; using grep -E
>   ...
>       @@ -1,4 +1,5 @@
>        QA output created by 447
>       +egrep: warning: egrep is obsolescent; using grep -E
>       ...
> 
> So use grep -E and -F to instead of egrep and fgrep commands.
> 
> Signed-off-by: Zorro Lang <zlang@kernel.org>
> ---
>  common/rc | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/common/rc b/common/rc
> index a25cbcd0..dee3965e 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -30,6 +30,17 @@ dd()
>  	fi
>  }
>  
> +# The egrep and fgrep are obsolescent
> +egrep()
> +{
> +	grep -E "$@"
> +}
> +
> +fgrep()
> +{
> +	grep -F "$@"
> +}

Why not conditionally define these *only* if the system doesn't already
have an egrep/fgrep binary?

(Alternately I guess you could take Murphy's patch, since that's the
proper fix according to the gnu grep maintainers...)

--D

> +
>  # Prints the md5 checksum of a given file
>  _md5_checksum()
>  {
> -- 
> 2.31.1
> 

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

* Re: [PATCH] common/rc: replace obsolescent egrep and fgrep
  2022-09-14 17:57 ` Darrick J. Wong
@ 2022-09-15  3:39   ` Zorro Lang
  0 siblings, 0 replies; 5+ messages in thread
From: Zorro Lang @ 2022-09-15  3:39 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: fstests

On Wed, Sep 14, 2022 at 10:57:55AM -0700, Darrick J. Wong wrote:
> On Tue, Sep 13, 2022 at 05:33:45PM +0800, Zorro Lang wrote:
> > Due to the change in grep project:
> >   a95156247098 ("egrep, fgrep: now obsolete")
> > 
> > some tests start to fail on latest Fedora system with grep-3.8-1.fc38
> > or newer version, as:
> > 
> >   generic/447 70s ... egrep: warning: egrep is obsolescent; using grep -E
> >   ...
> >       @@ -1,4 +1,5 @@
> >        QA output created by 447
> >       +egrep: warning: egrep is obsolescent; using grep -E
> >       ...
> > 
> > So use grep -E and -F to instead of egrep and fgrep commands.
> > 
> > Signed-off-by: Zorro Lang <zlang@kernel.org>
> > ---
> >  common/rc | 11 +++++++++++
> >  1 file changed, 11 insertions(+)
> > 
> > diff --git a/common/rc b/common/rc
> > index a25cbcd0..dee3965e 100644
> > --- a/common/rc
> > +++ b/common/rc
> > @@ -30,6 +30,17 @@ dd()
> >  	fi
> >  }
> >  
> > +# The egrep and fgrep are obsolescent
> > +egrep()
> > +{
> > +	grep -E "$@"
> > +}
> > +
> > +fgrep()
> > +{
> > +	grep -F "$@"
> > +}
> 
> Why not conditionally define these *only* if the system doesn't already
> have an egrep/fgrep binary?
> 
> (Alternately I guess you could take Murphy's patch, since that's the
> proper fix according to the gnu grep maintainers...)

OK, let's drop this patch, turn to review Murphy's. I just hope to avoid later
patches using egrep and fgrep commands.

Thanks,
Zorro

> 
> --D
> 
> > +
> >  # Prints the md5 checksum of a given file
> >  _md5_checksum()
> >  {
> > -- 
> > 2.31.1
> > 
> 

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

end of thread, other threads:[~2022-09-15  3:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-13  9:33 [PATCH] common/rc: replace obsolescent egrep and fgrep Zorro Lang
2022-09-13 12:27 ` David Disseldorp
2022-09-13 12:52   ` Zorro Lang
2022-09-14 17:57 ` Darrick J. Wong
2022-09-15  3:39   ` Zorro Lang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.