On Fri, Jun 03, 2022 at 06:09:38AM +0200, Michał Górny wrote:
> On Tue, 2022-05-31 at 07:23 -0400, Ionen Wolkens 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).
> > 
> 
> To be honest, I strongly dislike this.  It really feels like trying to
> make an adapter for a square wheel, while the right solution would be to
> replace the wheel.  On top of that, ton of evals which are pretty much
> a huge "no-no".

About evals, the two eval is just to silence this:

    var=$(printf "\0")

The 2>/dev/null doesn't work without wrapping it, aka

    eval 'var=$(printf "\0")' 2>/dev/null

No variables are expanded pre-eval so it's just evaluating a
static statement. eval can be removed, but it'll be noisy
if someone happens to sed binary files.

> 
> Perhaps it would be better to forget about trying to work miracles with
> sed and instead write a trivial shell replacement for the most common
> use cases.  One thing I'd love to see is a simple substitution command
> that would work for paths/CFLAGS on RHS without having to worry about
> them conflicting with the pattern delimiter.
> 
> -- 
> Best regards,
> Michał Górny
> 
> 

-- 
ionen

Attachment: signature.asc
Description: PGP signature

Reply via email to