From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 8F97F158091 for ; Fri, 3 Jun 2022 05:01:20 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B9979E0918; Fri, 3 Jun 2022 05:01:16 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0F340E0896 for ; Fri, 3 Jun 2022 05:01:16 +0000 (UTC) Date: Fri, 3 Jun 2022 01:01:11 -0400 From: Ionen Wolkens To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] [PATCH 0/2] Add esed.eclass for sed that dies if caused no changes Message-ID: Mail-Followup-To: gentoo-dev@lists.gentoo.org References: <20220531112319.29168-1-ionen@gentoo.org> <4906a074d4ad938f5efb3c257128ae34efcf2cb6.camel@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="dUoeksuszqyPHfsn" Content-Disposition: inline In-Reply-To: X-Archives-Salt: a0f1a114-22fc-49f3-a10a-96a9bdc1a361 X-Archives-Hash: c00c9024f330fd812154c777185a80cf --dUoeksuszqyPHfsn Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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=C5=82 G=C3=B3rny 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. > > > >=20 > > > > Inspired by app-portage/iwdevtools' qa-sed (warns on any seds), but > > > > this is for more deterministic use in ebuilds. > > > >=20 > > > > Also slightly shortens sed use, -i is default, and no need to || di= e. > > > > (see @EXAMPLE in eclass for a quick usage overview). > > > >=20 > > >=20 > > > 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". > >=20 > > About evals, the two eval is just to silence this: > >=20 > > var=3D$(printf "\0") >=20 > 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=3D$(=20 > > The 2>/dev/null doesn't work without wrapping it, aka > >=20 > > eval 'var=3D$(printf "\0")' 2>/dev/null > >=20 > > 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. > >=20 > > >=20 > > > Perhaps it would be better to forget about trying to work miracles wi= th > > > 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. > > >=20 > > > --=20 > > > Best regards, > > > Micha=C5=82 G=C3=B3rny > > >=20 > > >=20 > >=20 > > --=20 > > ionen >=20 >=20 >=20 --=20 ionen --dUoeksuszqyPHfsn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEx3SLh1HBoPy/yLVYskQGsLCsQzQFAmKZlZcACgkQskQGsLCs QzTlUQf+K+MKnZl2TkNKkb4sps+C/dItdWDYDlIqzn38pZJhIbSfG1Hy1Mc4D223 qWnGSKU0N2Vlt7eGq/JrW1Ra6d/Q9QE5u+j5/cjO6xlSBezG8EzZ6PBCq63ApiUq 1ROYx6wsBTqVoQd2TgVZy4XGev4nKyc9VegPv/DvK0T8/BPWQX4GBjNt6wgR3KIt i8u5FiR7ozIIvjyO0uqH75dcB3o2asUH1IlRcNEbQqhGVVMPKmwE+s/qrZeiysk9 hwhaIgBH3Af6yl3nuBtxPSzjGdCJsIt2mS/TbMXBPPXYxX5/IEyg/N8YBzykJjIr mPr12+f7qTYtuBHrMeMFztdz3qgvlw== =vxGh -----END PGP SIGNATURE----- --dUoeksuszqyPHfsn--