public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Ionen Wolkens <ionen@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] [PATCH 0/2] Add esed.eclass for sed that dies if caused no changes
Date: Fri, 3 Jun 2022 01:01:11 -0400	[thread overview]
Message-ID: <YpmVlyGj2iq/VBta@eversor> (raw)
In-Reply-To: <YpmSd6RYGfEjtSqt@sysrq.in>

[-- Attachment #1: Type: text/plain, Size: 2073 bytes --]

On Fri, Jun 03, 2022 at 09:47:51AM +0500, Anna V wrote:
> On 2022-06-03 00:45, Ionen Wolkens wrote:
> > 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")
> 
> printf -v var "\0"

That was just for the sake of showing what happens, the eclass is
reading a file and isn't using printf. aka: var=$(<file)

> 
> > 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
> 
> 
> 

-- 
ionen

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2022-06-03  5:01 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-31 11:23 [gentoo-dev] [PATCH 0/2] Add esed.eclass for sed that dies if caused no changes Ionen Wolkens
2022-05-31 11:23 ` [gentoo-dev] [PATCH 1/2] esed.eclass: new eclass Ionen Wolkens
2022-05-31 13:45   ` Ionen Wolkens
2022-06-03  7:14   ` Ulrich Mueller
2022-06-03  9:26     ` Ionen Wolkens
2022-06-03 11:19       ` Ionen Wolkens
2022-05-31 11:23 ` [gentoo-dev] [PATCH 2/2] eclass/tests/esed.sh: basic tests for esed.eclass Ionen Wolkens
2022-05-31 13:54 ` [gentoo-dev] [PATCH 0/2] Add esed.eclass for sed that dies if caused no changes Anna
2022-05-31 14:29   ` Ionen Wolkens
2022-05-31 14:44     ` Jaco Kroon
2022-06-03  4:09 ` Michał Górny
2022-06-03  4:45   ` Ionen Wolkens
2022-06-03  4:47     ` Anna V
2022-06-03  5:01       ` Ionen Wolkens [this message]
2022-06-03  5:00     ` Anna V
2022-06-03  5:05   ` Ionen Wolkens
2022-06-03  4:59 ` Sam James
2022-06-03  5:02   ` Sam James
2022-06-03 11:36 ` [gentoo-dev] [PATCH v2 0/1] esed Ionen Wolkens
2022-06-03 11:36   ` [gentoo-dev] [PATCH v2 1/1] esed.eclass: new eclass Ionen Wolkens
2022-06-04  0:15     ` Oskari Pirhonen
2022-06-04  7:00       ` Ionen Wolkens
2022-06-03 14:13   ` [gentoo-dev] [PATCH v2 0/1] esed Ionen Wolkens
2022-06-04 16:19 ` [gentoo-dev] [PATCH 0/2] Add esed.eclass for sed that dies if caused no changes Alessandro Barbieri
2022-06-04 16:53   ` Ionen Wolkens

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YpmVlyGj2iq/VBta@eversor \
    --to=ionen@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox