Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[gentoo-dev] [PATCH 2/2] qmail.eclass: remove usage of egrep

5 views
Skip to first unread message

Rolf Eike Beer

unread,
May 16, 2022, 10:50:03 AM5/16/22
to
This does not use extended regular expressions in any way. While at it change
the way these matches are done: it's irrelevant if the entire expression is in
the file, if there is any rule for the given IP address then do not add the
new
expression.

Signed-off-by: Rolf Eike Beer <ei...@sf-mail.de>
---
eclass/qmail.eclass | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/eclass/qmail.eclass b/eclass/qmail.eclass
index 9b2c5a8c7fb..ed53bca56fa 100644
--- a/eclass/qmail.eclass
+++ b/eclass/qmail.eclass
@@ -409,7 +409,7 @@ qmail_config_fast() {
}

qmail_tcprules_config() {
- local localips ip tcpstring line proto f
+ local localips ip tcpstring proto f

einfo "Accepting relaying by default from all ips configured on
this machine."

@@ -425,10 +425,9 @@ qmail_tcprules_config() {
tcpstring=':allow,RELAYCLIENT="",RBLSMTPD=""'

for ip in ${localips}; do
- line="${ip}${tcpstring}"
for proto in smtp qmtp qmqp; do
f="${EROOT}${TCPRULES_DIR}/tcp.qmail-$
{proto}"
- egrep -qs "${line}" "${f}" || echo "${line}"
>> "${f}"
+ grep -qs "^${ip}:" "${f}" || echo "${ip}$
{tcpstring}" >> "${f}"
done
done
}
--
2.35.3

signature.asc

Ulrich Mueller

unread,
May 21, 2022, 4:50:03 AM5/21/22
to
>>>>> On Mon, 16 May 2022, Rolf Eike Beer wrote:

> This does not use extended regular expressions in any way. While at it change
> the way these matches are done: it's irrelevant if the entire expression is in
> the file, if there is any rule for the given IP address then do not add the
> new
> expression.

Series LGTM. However, "git am" fails for the second patch because the
line breaks in your message are messed up:

Applying: qmail.eclass: remove usage of egrep
error: corrupt patch at line 17
Patch failed at 0001 qmail.eclass: remove usage of egrep

(I believe the problem is not on my side, because I see the spurious
line breaks also in archives:
https://archives.gentoo.org/gentoo-dev/message/b34c3f96f9e4069516b1457e7b0b4904#L32 )
signature.asc

Rolf Eike Beer

unread,
May 21, 2022, 5:10:03 AM5/21/22
to
This is likely a problem of the GPG signing.

You can get the patches directly from git here:

https://github.com/DerDakon/gentoo/tree/qmail-eclass
signature.asc

Ulrich Mueller

unread,
May 21, 2022, 1:10:02 PM5/21/22
to
>>>>> On Sat, 21 May 2022, Rolf Eike Beer wrote:

> You can get the patches directly from git here:
> https://github.com/DerDakon/gentoo/tree/qmail-eclass

Thanks, merged.
signature.asc
0 new messages