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

    From Rolf Eike Beer@21:1/5 to All on Mon May 16 16:50:01 2022
    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 <eike@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


    -----BEGIN PGP SIGNATURE-----

    iF0EABECAB0WIQSaYVDeqwKa3fTXNeNcpIk+abn8TgUCYoJkdQAKCRBcpIk+abn8 Tj65AJ9C6apFIy1JVaLZJcOO
  • From Rolf Eike Beer@21:1/5 to All on Sat May 21 11:10:01 2022
    Am Samstag, 21. Mai 2022, 10:44:35 CEST schrieb Ulrich Mueller:
    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/b34c3f96f9e4069516b1457e7b0b4 904#L32 )

    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

    -----BEGIN PGP SIGNATURE-----

    iF0EABECAB0WIQSaYVDeqwKa3fTXNeNcpIk+abn8TgUCYoirdAAKCRBcpIk+abn8 TtTzAJ4o2EjYuSZXmXG0xjEnkwHJ7ztZXgCgjWVOiOekc2qkVjXWKM4HVq1kii4=
    =OzpD
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ulrich Mueller@21:1/5 to All on Sat May 21 10:50:01 2022
    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 )

    --=-=-Content-Type: application/pgp-signature; name="signature.asc"

    -----BEGIN PGP SIGNATURE-----

    iQFDBAEBCAAtFiEEtDnZ1O9xIP68rzDbUYgzUIhBXi4FAmKIpnMPHHVsbUBnZW50 b28ub3JnAAoJEFGIM1CIQV4uN0IH/0271yKGt88e1Xl4sN/OHGf5N4Jw9lBu62Nu aalA14PwYqoKzekULM85No/Yub2W63R3fP+2PRxWzE0G/P1vNwp+PEqGS7JkviCF Fi5vOkrDSUPkar6m8v2jLG3ONRTJqEavT34mpBZI1gAYMLCZeHaAJkxQ6E5+KEQB V1fjwTLGXdzJ6dMBJ2IfTg6WkHhGxEaIwVW5r2uqFSikicfmSSmC9V++h1b05cs5 5cFHXYekJLqrevSY2UU8DgHVmTWhTdVFKgrHAv1owxDF88gXqD5opBRRj7aPGSrA 4an3BGfYlxvEHdLIOjQIKmEzfkpOcMyTCKy4c5UMOfEsnZp1gd8=UTFT
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ulrich Mueller@21:1/5 to All on Sat May 21 19:10:01 2022
    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.

    -----BEGIN PGP SIGNATURE-----

    iQFDBAEBCAAtFiEEtDnZ1O9xIP68rzDbUYgzUIhBXi4FAmKJGtwPHHVsbUBnZW50 b28ub3JnAAoJEFGIM1CIQV4u4WoIAMkjjvN4+/4Cwj6bg3+Rz50PBkIHx9QOKhmN idGtU6PSkRbqn9MuAdCpDUfb78++ECal7TWFAb/0u6nredqBg+aYBr8k1RbwvQ0T UE1onpQzR48Hic57XEbR08Tmwg2vKcXlNiuCgMcB0FY7bza8fY7DNvqszxR9G17z 7I0zGTJglZi6uckNl/Ca/UCxnDfTy371INP8fQK7IBZ/FSdicVCJiweM1zy4iTCa JNWK9PqadHqTrwS9kXU1+6taMNmjGYtV/Up2qtsqF9cngPLyisAJ2U1weIYQjmCP 6ffXma/vHY722lRn0QMhKymGAU1PwCX5YCKI4rB7nQoiJx/L0AM=
    =iQEs
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)