> On 3 Jun 2022, at 05:59, Sam James <s...@gentoo.org> wrote:
> 
> 
> 
>> On 31 May 2022, at 12:23, Ionen Wolkens <io...@gentoo.org> wrote:
>> 
>> Often preferable to use patches so this happens, but sed have its
>> uses/convenience and this intend to help reduce the amount of old
>> broken seds causing issues that go unnoticed on bumps.
>> 
>> Inspired by app-portage/iwdevtools' qa-sed (warns on any seds), but
>> this is for more deterministic use in ebuilds.
>> 
>> Also slightly shortens sed use, -i is default, and no need to || die.
>> (see @EXAMPLE in eclass for a quick usage overview).
>> 
>> Implementation / available wrappers / usefulness still up for debate,
>> but without further comments I consider this ready (albeit first time
>> touching / making an eclass, so I could be overlooking simple things).
>> Also partly uses >=bash-4.4, so EAPI-7 is not considered.
>> 
>> See github PR[1] for old changelog background.
>> 
>> Up to maintainers but personally would encourage to slowly replace
>> (almost) all use of sed with either this or patches. Some cases
>> where it can be inconvenient like eclasses "guessing" that a package
>> may or may not have something to replace, and that nothing happened
>> is not an issue.
>> 
> 
> I like it. I'd prefer it if GNU sed supported it by itself (exit code 
> indicating
> if any changes were made) but it doesn't right now.
> 
> Ebuilds use sed aplenty and making it easier to be "less bad" is a good
> thing. It's a practical solution to a real problem we have (zombie seds,
> or more rarely, overzealous-and-not-realising-it seds).
> 
> I don't want us to have to keep it forever and I wouldn't want
> people to actively use this instead of patches, but they certainly should
> instead of sed.
> 

Also, I like that we let ourselves experiment a bit with edo.eclass,
and I don't see this as too different from that. Unless something is
absolutely the wrong approach and we know it won't go anywhere,
I think exploring options is generally a good thing.

Plus, we've seen the actual need for this from iwdevtools usage
(warns on such zombie seds). Let's give it a go, I think?

>> [1] https://github.com/gentoo/gentoo/pull/25662
>> 
>> Ionen Wolkens (2):
>> esed.eclass: new eclass
>> eclass/tests/esed.sh: basic tests for esed.eclass
>> 
>> eclass/esed.eclass | 199 +++++++++++++++++++++++++++++++++++++++++++
>> eclass/tests/esed.sh | 173 +++++++++++++++++++++++++++++++++++++
>> 2 files changed, 372 insertions(+)
>> create mode 100644 eclass/esed.eclass
>> create mode 100755 eclass/tests/esed.sh
>> 
>> --
>> 2.35.1
>> 
> 
> best,
> sam

Attachment: signature.asc
Description: Message signed with OpenPGP

Reply via email to