Gentoo Archives: gentoo-dev

From: Mike Frysinger <vapier@g.o>
To: "Amadeusz Żołnowski" <aidecoe@g.o>
Cc: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH] eutils.eclass: Add awk wrapper - eawk - edit file in place
Date: Sun, 22 May 2016 00:45:30
Message-Id: 20160522004518.GG26300@vapier.lan
In Reply to: Re: [gentoo-dev] [PATCH] eutils.eclass: Add awk wrapper - eawk - edit file in place by "Amadeusz Żołnowski"
1 On 21 May 2016 17:08, Amadeusz Żołnowski wrote:
2 > Mike Frysinger <vapier@g.o> writes:
3 > >> The same "sed -i" is used. I have some configs to edit in place in
4 > >> src_prepare(). It's easier with awk rather than sed.
5 > >
6 > > again, provide an example. one or two uncommon use cases doesn't justify
7 > > being added to eutils.
8 >
9 > See rebar.eclass review where it is used. Later ejabberd ebuild I'm
10 > going to add uses it as well.
11
12 neither of those are terribly compelling and can be written in sed.
13 you want to do a match & replace in that just as easily. roughly:
14 sed -i \
15 -e '/{[[:space:]]*deps[[:space:]]*,\/,\/}/{s:.*:{deps, []}:}' \
16 foo
17
18 > This function is too generic to be in
19 > rebar.eclass, so I have decided to move it to eutils. What is the
20 > problem with adding it to eutils?
21
22 because no one else is using it or cares about it. we've gotten by
23 for more than 10 years at this point w/out someone asking for this.
24
25 if you really want it in rebar, then just DEPEND on gawk and use the
26 inplace flag in your code. then there's no need for eawk anywhere.
27 -mike

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies