Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH 0/2] Add esed.eclass for sed that dies if caused no changes
Date: Fri, 03 Jun 2022 04:09:50
In Reply to: [gentoo-dev] [PATCH 0/2] Add esed.eclass for sed that dies if caused no changes by Ionen Wolkens
1 On Tue, 2022-05-31 at 07:23 -0400, Ionen Wolkens wrote:
2 > Often preferable to use patches so this happens, but sed have its
3 > uses/convenience and this intend to help reduce the amount of old
4 > broken seds causing issues that go unnoticed on bumps.
5 >
6 > Inspired by app-portage/iwdevtools' qa-sed (warns on any seds), but
7 > this is for more deterministic use in ebuilds.
8 >
9 > Also slightly shortens sed use, -i is default, and no need to || die.
10 > (see @EXAMPLE in eclass for a quick usage overview).
11 >
13 To be honest, I strongly dislike this. It really feels like trying to
14 make an adapter for a square wheel, while the right solution would be to
15 replace the wheel. On top of that, ton of evals which are pretty much
16 a huge "no-no".
18 Perhaps it would be better to forget about trying to work miracles with
19 sed and instead write a trivial shell replacement for the most common
20 use cases. One thing I'd love to see is a simple substitution command
21 that would work for paths/CFLAGS on RHS without having to worry about
22 them conflicting with the pattern delimiter.
24 --
25 Best regards,
26 Michał Górny