Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o, Sam James <sam@g.o>
Cc: qa@g.o, base-system@g.o
Subject: Re: [gentoo-dev] [PATCH v2 4/5] qmail.eclass: egrep -> grep -E
Date: Sun, 15 May 2022 16:57:18
Message-Id: 1b8aafcf29ea69b920ebeb1e9dc8734a6c3e5b25.camel@gentoo.org
In Reply to: Re: [gentoo-dev] [PATCH v2 4/5] qmail.eclass: egrep -> grep -E by Rolf Eike Beer
1 On Sun, 2022-05-15 at 17:18 +0200, Rolf Eike Beer wrote:
2 > Am Sonntag, 15. Mai 2022, 03:08:41 CEST schrieb Sam James:
3 > > Signed-off-by: Sam James <sam@g.o>
4 > > ---
5 > > eclass/qmail.eclass | 2 +-
6 > > 1 file changed, 1 insertion(+), 1 deletion(-)
7 > >
8 > > diff --git a/eclass/qmail.eclass b/eclass/qmail.eclass
9 > > index 471f2fe7ce5e..707cc91adfd8 100644
10 > > --- a/eclass/qmail.eclass
11 > > +++ b/eclass/qmail.eclass
12 > > @@ -452,7 +452,7 @@ qmail_tcprules_config() {
13 > > line="${ip}${tcpstring}"
14 > > for proto in smtp qmtp qmqp; do
15 > > f="${EROOT}${TCPRULES_DIR}/tcp.qmail-${proto}"
16 > > - egrep -qs "${line}" "${f}" || echo "${line}" >> "${f}"
17 > > + grep -E -qs "${line}" "${f}" || echo "${line}" >> "${f}"
18 > > done
19 > > done
20 > > }
21 >
22 > NACK, but for the simple reason that this doesn't need the extended syntax
23 > at all. Just drop it and use plain grep here.
24
25 Does it use a regex at all? Maybe 'grep -F' would be more appropriate.
26
27 --
28 Best regards,
29 Michał Górny