[Buildroot] [PATCH 4/5] support/download: only create final temp file when needed

Arnout Vandecappelle arnout at mind.be
Tue Jul 8 15:53:49 UTC 2014

On 07/07/14 23:53, Yann E. MORIN wrote:
> Arnout, All,
> On 2014-07-07 18:08 +0200, Arnout Vandecappelle spake thusly:
>> On 06/07/14 23:27, Yann E. MORIN wrote:
>>> +# Upon failure, git cleans behind itself, so no need to catch failures here.
>>> +# The only case when git would not clean up, is if it gets killed with SIGKILL.
>>  I think the SIGKILL is reason enough to do the rm explicitly in the script. Of
>> course, this is only valid if you use the trap, otherwise you never reach the rm
> Well, SIGKILL is not catchable. That's the main selling point of SIGKILL.
> ;-)

 If git gets SIGKILLed, the shell script is still running.

>> (due to 'set -e').
> Well, 'set -e' only kicks in for the final 'mv', since all other
> commands and conditions in an if statement.

 The call to git clone isn't, though.

> Also, I'm not a big fan of traps, although I can be abusing them from
> time to time.

 I do agree that trap is mightily confusing: it has obscure syntax, and you can
easily accidentally replace an earlier trap. So in fact, it would be better not
to use 'set -e' but to put everything in conditions. But that just moves the
problem elsewhere...


> But OK, I'll add this to the TODO...
> Regards,
> Yann E. MORIN.

Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

More information about the buildroot mailing list