On Sat, 21 May 2016 20:45:18 -0400
Mike Frysinger wrote:
> On 21 May 2016 17:08, Amadeusz Żołnowski wrote:
> > 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
On 21 May 2016 17:08, Amadeusz Żołnowski 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
Michał Górny writes:>
>> +# Following commands should always succeed unless something weird is
>> going
>> +# on.
>> +cat "${tmpf}" >"${f}" || die 'failed to replace source file' || return
>> +rm "${tmpf}" || die "failed to remove temporary file"
>
> Any reason
On Sat, 21 May 2016 14:49:41 +0100
aide...@gentoo.org wrote:
> From: Amadeusz Żołnowski
>
> awk doesn't have the -i option like sed and if editing file in place is
> desired, additional steps are required. eawk uses tmp file to make it
> look to the caller editing happens in
On 05/21/2016 06:08 PM, Amadeusz Żołnowski 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
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 justify
> being added to eutils.
See rebar.eclass review
On 20 May 2016 21:09, Amadeusz Żołnowski wrote:
> Mike Frysinger writes:
> > On 18 May 2016 22:25, aide...@gentoo.org wrote:
> >> awk doesn't have the -i option like sed and if editing file in place is
> >> desired, additional steps are required. eawk uses tmp file to make it
>
From: Amadeusz Żołnowski
awk doesn't have the -i option like sed and if editing file in place is
desired, additional steps are required. eawk uses tmp file to make it
look to the caller editing happens in place.
New version of gawk (not stabilized yet) does support editing
From: Amadeusz Żołnowski
awk doesn't have the -i option like sed and if editing file in place is
desired, additional steps are required. eawk uses tmp file to make it
look to the caller editing happens in place.
New version of gawk (not stabilized yet) does support editing
Amadeusz Żołnowski writes:
> Indeed. So one of these:
>
> a) eawk
> b) eawk --
> c) eawk --
Ups, actually (c) wouldn't be correct either, so only (a) and (b) and
I'd just stick to (a) to not complicate things.
--
Amadeusz Żołnowski
signature.asc
Description:
> a) mawk doesn't support it.
> b) 4.1 is not stabilized, yet.
a) if you depend on mawk then you can really create your own wrapper
in your ebuild or do it inline
b) then perhaps put your efforts that way
Mike Frysinger writes:
> On 18 May 2016 22:25, aide...@gentoo.org wrote:
>> awk doesn't have the -i option like sed and if editing file in place is
>> desired, additional steps are required. eawk uses tmp file to make it
>> look to the caller editing happens in place.
>
>
rindeal writes:
> Have you guys read
> https://stackoverflow.com/questions/16529716/awk-save-modifications-inplace
> ?
a) mawk doesn't support it.
b) 4.1 is not stabilized, yet.
-- Amadeusz Żołnowski
signature.asc
Description: PGP signature
Reasons for inplace editing are the same for any language and tool,
but having a wrapper just because some tool doesn't support it, is a
bloat. Especially when gawk>=4.1 supports it.
Thursday 19 May 2016 23:08:05, Mike Frysinger wrote :
> On 18 May 2016 22:25, aide...@gentoo.org wrote:
> > awk doesn't have the -i option like sed and if editing file in place is
> > desired, additional steps are required. eawk uses tmp file to make it
> > look to the caller editing happens in
Have you guys read
https://stackoverflow.com/questions/16529716/awk-save-modifications-inplace
?
"Robin H. Johnson" writes:
>> > cp -f "${tmpf}" "$f" || die "copy back failed"
>>
>> Why '-f' is required?
> Corner cases w/ copying and bad ebuild usage (specifically running
> ebuild as two different non-root users during development). Mostly
> habit.
Reading:
Mart Raudsepp writes:
> Similarly, I would like that all ebuild that call 'sed' actually DEPEND
> on sed, not just half of them.
> I would also like that no ebuild would assume packages in @system to be
> present, beyond those dictated by PMS (unpackers and such).
Please don't
> On Thu, 19 May 2016, Amadeusz Żołnowski wrote:
> Ulrich Mueller writes:
>> Yes, of course. "|| die -n || return" if you want the function to
>> return at that point, if it was called under nonfatal.
>>
>>>
On 18 May 2016 22:25, aide...@gentoo.org wrote:
> awk doesn't have the -i option like sed and if editing file in place is
> desired, additional steps are required. eawk uses tmp file to make it
> look to the caller editing happens in place.
what's your real use case ? i've never once thought
On 20 May 2016 02:16, Mart Raudsepp wrote:
> I would like if such a function would explicitly document that calling
> this function means the caller should DEPEND on an awk provider.
> Similarly, I would like that all ebuild that call 'sed' actually DEPEND
> on sed, not just half of them.
> I
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512
Mart Raudsepp:
> Ühel kenal päeval, K, 18.05.2016 kell 22:25, kirjutas
> aide...@gentoo.org:
>> From: Amadeusz Żołnowski
>>
>> awk doesn't have the -i option like sed and if editing file in
>> place is desired, additional
Ühel kenal päeval, K, 18.05.2016 kell 22:25, kirjutas
aide...@gentoo.org:
> From: Amadeusz Żołnowski
>
> awk doesn't have the -i option like sed and if editing file in place
> is
> desired, additional steps are required. eawk uses tmp file to make it
> look to the caller
On Thu, May 19, 2016 at 10:50:48PM +0100, Amadeusz Żołnowski wrote:
> "Robin H. Johnson" writes:
> > 1.
> > If your AWK command has an error, then this clobbers the file, a
> > better variant, with die, would be:
> > awk "$@" "$f" >"${tmpf}" || die "awk failed..."
> > cp -f
"Robin H. Johnson" writes:
> 1.
> If your AWK command has an error, then this clobbers the file, a
> better variant, with die, would be:
> awk "$@" "$f" >"${tmpf}" || die "awk failed..."
> cp -f "${tmpf}" "$f" || die "copy back failed"
Thanks! On the one hand it's a simple
Ulrich Mueller writes:
> Yes, of course. "|| die -n || return" if you want the function to
> return at that point, if it was called under nonfatal.
>
>> https://blogs.gentoo.org/mgorny/2015/11/13/the-ultimate-guide-to-eapi-6
>
> Note that the ${?} in the code example there is
> On Thu, 19 May 2016, Mart Raudsepp wrote:
>> Ulrich Mueller writes:
>> > The EAPI 6 method would be to use "|| die -n". Then the caller
>> > either call "eawk" if the function should die automatically, or
>> > "nonfatal eawk" if it should return with an error status.
>
Ühel kenal päeval, N, 19.05.2016 kell 18:51, kirjutas Amadeusz
Żołnowski:
> Ulrich Mueller writes:
> > The EAPI 6 method would be to use "|| die -n". Then the caller can
> > either call "eawk" if the function should die automatically, or
> > "nonfatal eawk" if it should return
Ulrich Mueller writes:
> The EAPI 6 method would be to use "|| die -n". Then the caller can
> either call "eawk" if the function should die automatically, or
> "nonfatal eawk" if it should return with an error status.
Yes, that seems better. Hasn't it been introduced earlier
> On Wed, 18 May 2016, Amadeusz Żołnowski wrote:
>> Also, wouldn't the absence of 'die' cause silent breakages?
> I want to caller decide whether die or not and what error messge to
> give.
The EAPI 6 method would be to use "|| die -n". Then the caller can
either call "eawk" if the function
Jeroen Roovers:
> On Wed, 18 May 2016 19:31:38 -0400
> Göktürk Yüksek wrote:
>
>> There could be some performance implications. cat will usually do
>> slow, buffered I/O. cp tries to be smarter with allocation, i.e. it
>> may take advantage of the btrfs specific clone to do a
On Wed, 18 May 2016 19:31:38 -0400
Göktürk Yüksek wrote:
> There could be some performance implications. cat will usually do
> slow, buffered I/O. cp tries to be smarter with allocation, i.e. it
> may take advantage of the btrfs specific clone to do a O(1) copy.
Really?
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512
Amadeusz Żołnowski:
> Göktürk Yüksek writes:
>>> + cat "${f}" >"${tmpf}" || return 1
>> Why shell redirection with cat instead of cp? both are in
>> coreutils.
>
> I thought cp could overwrite file mode of already existing
Göktürk Yüksek writes:
>> +cat "${f}" >"${tmpf}" || return 1
> Why shell redirection with cat instead of cp? both are in coreutils.
I thought cp could overwrite file mode of already existing tmp file, but
actually it doesn't, so cp can be here as well. Is there actual
On Wed, May 18, 2016 at 10:25:02PM +0100, aide...@gentoo.org wrote:
> From: Amadeusz Żołnowski
>
> awk doesn't have the -i option like sed and if editing file in place is
> desired, additional steps are required. eawk uses tmp file to make it
> look to the caller editing
aide...@gentoo.org:
> From: Amadeusz Żołnowski
>
> awk doesn't have the -i option like sed and if editing file in place is
> desired, additional steps are required. eawk uses tmp file to make it
> look to the caller editing happens in place.
> ---
> eclass/eutils.eclass | 13
From: Amadeusz Żołnowski
awk doesn't have the -i option like sed and if editing file in place is
desired, additional steps are required. eawk uses tmp file to make it
look to the caller editing happens in place.
---
eclass/eutils.eclass | 13 +
1 file changed, 13
37 matches
Mail list logo