[Buildroot] [PATCH] check-kernel-headers.sh: use a trap to remove the temporary file

Arnout Vandecappelle arnout at mind.be
Tue Sep 24 20:35:02 UTC 2019



On 24/09/2019 12:50, yann.morin at orange.com wrote:
> Carlos, All,
> 
> On 2019-09-23 23:49 -0300, unixmania at gmail.com spake thusly:
>> From: Carlos Santos <unixmania at gmail.com>
>>
>> The POSIX specification defines a 'trap <action> EXIT' mechanism that is
>> useful to perform clean-up actions in shell scripts. A trap has two main
>> advantages over hand-crafted clean-up mechanisms:
>>
>> - It runs even if the process is terminated by a SIGTERM.
>> - It runs even if the script stops due to a pipeline failure (set -e).
>>
>> Now we can make the script to stop immediately if a compilation error
>> occurs, instead of letting it try to run an unexisting program.
>>
>> This change may appear to be overkill but Buildroot is an open source
>> project and each piece of code is a potential learning tool for other
>> developments. We must strive to provide good examples.

> This last paragraph is not useful in this commit log.

 But it is very true :-)

 Regards,
 Arnout


More information about the buildroot mailing list