Gentoo Archives: gentoo-dev

From: "Göktürk Yüksek" <gokturk@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH] eutils.eclass: Add awk wrapper - eawk - edit file in place
Date: Wed, 18 May 2016 23:31:53
Message-Id: 573CFB5A.2090905@gentoo.org
In Reply to: Re: [gentoo-dev] [PATCH] eutils.eclass: Add awk wrapper - eawk - edit file in place by "Amadeusz Żołnowski"
1 -----BEGIN PGP SIGNED MESSAGE-----
2 Hash: SHA512
3
4 Amadeusz Żołnowski:
5 > Göktürk Yüksek <gokturk@g.o> writes:
6 >>> + cat "${f}" >"${tmpf}" || return 1
7 >> Why shell redirection with cat instead of cp? both are in
8 >> coreutils.
9 >
10 > I thought cp could overwrite file mode of already existing tmp
11 > file, but actually it doesn't, so cp can be here as well. Is there
12 > actual benefit of using cp here?
13 >
14 There could be some performance implications. cat will usually do
15 slow, buffered I/O. cp tries to be smarter with allocation, i.e. it
16 may take advantage of the btrfs specific clone to do a O(1) copy.
17
18 >> Also, wouldn't the absence of 'die' cause silent breakages?
19 >
20 > I want to caller decide whether die or not and what error messge
21 > to give.
22 >
23 Maybe that should be part of the documentation. People are more likely
24 to assume that it will die on its own, I think. Is there a case in
25 which you would not want to die?
26
27 > Cheers,
28 >
29
30 -----BEGIN PGP SIGNATURE-----
31
32 iQEcBAEBCgAGBQJXPPtVAAoJEIT4AuXAiM4zhX4H+gNivSvNvQzf3tsjmbVatGWB
33 DLIvIxUY7h79c0YDTXnaU+4LLf7CvED26XT9QNWp297OfNpsXKWGTR5GbdG+w0ab
34 SR490l9Uh/qn8HBKvh1hmPTEyeRHXm0ZoQ6/jrgwlz7ehSawQlzGRUPqFOHj88Fc
35 qwWhKk1p2fc7TUnRO0SUY/xcRyZeEyUqEG3ueVYfPlTo10rC5+B20IFjnO09vwbT
36 INV27KHqjLnpRT4xGWvCyCiEfw6DDypxZ/PKfr4c7omHF8OF+5GGnf+FFZ8UJFkt
37 93TVIPDeUC9XeAsmqirgN5LuYWsNNUwTEdiDfjglLrTb6OgXA0eIIwXsGH/G3d4=
38 =J3uT
39 -----END PGP SIGNATURE-----

Replies