From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 4D9DB138262 for ; Sun, 22 May 2016 00:45:30 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4786F1422E; Sun, 22 May 2016 00:45:21 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 3E68F21C043 for ; Sun, 22 May 2016 00:45:20 +0000 (UTC) Received: from vapier.lan (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with SMTP id 898C5340BC9; Sun, 22 May 2016 00:45:18 +0000 (UTC) Date: Sat, 21 May 2016 20:45:18 -0400 From: Mike Frysinger To: Amadeusz =?utf-8?B?xbtvxYJub3dza2k=?= Cc: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] [PATCH] eutils.eclass: Add awk wrapper - eawk - edit file in place Message-ID: <20160522004518.GG26300@vapier.lan> Mail-Followup-To: Amadeusz =?utf-8?B?xbtvxYJub3dza2k=?= , gentoo-dev@lists.gentoo.org References: <1463606702-16578-1-git-send-email-aidecoe@gentoo.org> <20160520030805.GV26300@vapier.lan> <87k2iowkxe.fsf@freja.aidecoe.name> <20160521145816.GC26300@vapier.lan> <8737pb5r7b.fsf@freja.aidecoe.name> 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 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="71MxWb38FuvvANV0" Content-Disposition: inline In-Reply-To: <8737pb5r7b.fsf@freja.aidecoe.name> X-Archives-Salt: d8d6bbdf-e20b-42da-9c3b-d98ec57fad75 X-Archives-Hash: 72ae4dd1041a0fb6ac3b9f4fed3e484e --71MxWb38FuvvANV0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 21 May 2016 17:08, Amadeusz =C5=BBo=C5=82nowski wrote: > Mike Frysinger writes: > >> The same "sed -i" is used. I have some configs to edit in place in > >> src_prepare(). It's easier with awk rather than sed. > > > > again, provide an example. one or two uncommon use cases doesn't justi= fy > > being added to eutils. >=20 > See rebar.eclass review where it is used. Later ejabberd ebuild I'm > going to add uses it as well. neither of those are terribly compelling and can be written in sed. you want to do a match & replace in that just as easily. roughly: sed -i \ -e '/{[[:space:]]*deps[[:space:]]*,\/,\/}/{s:.*:{deps, []}:}' \ foo > This function is too generic to be in > rebar.eclass, so I have decided to move it to eutils. What is the > problem with adding it to eutils? because no one else is using it or cares about it. we've gotten by for more than 10 years at this point w/out someone asking for this. if you really want it in rebar, then just DEPEND on gawk and use the inplace flag in your code. then there's no need for eawk anywhere. -mike --71MxWb38FuvvANV0 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXQQEdAAoJEEFjO5/oN/WBoxgQAJ73eCctFtoDPs63wc8t2Q44 11QZ1Ii5wSaa8kdaYmYGWPz6Snl8c1l/fV/0p9gvL6dyWaLhICCVMnrbevlK/ES7 EgzPRUVnM6FNxAd2YW85XBar3vqQjs08lRa9miSnXzXwrDxU/lhYF2m869m4X881 Pxvvic8SHtZx+Pn3X2WsJKgcqJ2NU0ADWE61B5OhqsnY29VgHVzlq1Gs4cU4Mzu1 zutCZfOiE/B96/2bfadPp2AKyf+z6GJ5pwFVEi1z6ZVp+EIEvo8MglyknZGE6nTk Y0m8ifCtyrQvhkvSGMTu7OpEClEEzfofa2NolsnpHaqyXNDMVy7fIwbe469XtFz/ +MooUj0CfQrpf61pfd0JczS7smk2DG8WAL/+qM+oEw9pWHX35DzxxWYpmRoBsXhD ubW28Zp0gI9ffWOBSRmhaHOEDuHg7LIgVHuEKaX5mKmSplNVp4TJ+B/T4uNzdIOg lDDu5M6JvWQLSZ9h4pnSaKytfJ9cD5hXcpEQEll/dDFm+LpMQNx/dWgI95cA7FIn l4S+kQpUqg3i0sA6NhyI6KyBiA3xsjgdWjOAb4qP0Mb1G2K1NujXYoAivnG81R+U uT9MGXCSNbtefQAkdIXORcaoEKxGkC/xkAZokohwvWvLh1UNybgTU8SAvZFN/T6O OSjbLG+BcQHvCaZS+HMr =Xaww -----END PGP SIGNATURE----- --71MxWb38FuvvANV0--