diff mbox

apply-patches: catch unexpected failure

Message ID 1467716529-30183-1-git-send-email-romain.naour@gmail.com
State Accepted
Headers show

Commit Message

Romain Naour July 5, 2016, 11:02 a.m. UTC
As reported by Sébastien Szymanski [1], the apply-patches script
doesn't stop if a tar command can't extract an archive.

Use "set -e" to exit immediately if a command return an error.

[1] http://patchwork.ozlabs.org/patch/626196

Signed-off-by: Romain Naour <romain.naour@gmail.com>
Cc: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
---
 support/scripts/apply-patches.sh | 3 +++
 1 file changed, 3 insertions(+)

Comments

Thomas Petazzoni July 5, 2016, 3:37 p.m. UTC | #1
Hello,

On Tue,  5 Jul 2016 13:02:09 +0200, Romain Naour wrote:
> As reported by Sébastien Szymanski [1], the apply-patches script
> doesn't stop if a tar command can't extract an archive.
> 
> Use "set -e" to exit immediately if a command return an error.
> 
> [1] http://patchwork.ozlabs.org/patch/626196
> 
> Signed-off-by: Romain Naour <romain.naour@gmail.com>
> Cc: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
> ---
>  support/scripts/apply-patches.sh | 3 +++
>  1 file changed, 3 insertions(+)

Applied to master, thanks.

Thomas
Thomas Petazzoni July 5, 2016, 3:43 p.m. UTC | #2
Hello,

On Tue,  5 Jul 2016 13:02:09 +0200, Romain Naour wrote:
> As reported by Sébastien Szymanski [1], the apply-patches script
> doesn't stop if a tar command can't extract an archive.
> 
> Use "set -e" to exit immediately if a command return an error.
> 
> [1] http://patchwork.ozlabs.org/patch/626196
> 
> Signed-off-by: Romain Naour <romain.naour@gmail.com>
> Cc: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
> ---
>  support/scripts/apply-patches.sh | 3 +++
>  1 file changed, 3 insertions(+)

In fact, this broke many packages, so I reverted.

Thomas
Romain Naour July 5, 2016, 3:46 p.m. UTC | #3
Hi Thomas,
Le 05/07/2016 à 17:43, Thomas Petazzoni a écrit :
> Hello,
> 
> On Tue,  5 Jul 2016 13:02:09 +0200, Romain Naour wrote:
>> As reported by Sébastien Szymanski [1], the apply-patches script
>> doesn't stop if a tar command can't extract an archive.
>>
>> Use "set -e" to exit immediately if a command return an error.
>>
>> [1] http://patchwork.ozlabs.org/patch/626196
>>
>> Signed-off-by: Romain Naour <romain.naour@gmail.com>
>> Cc: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
>> ---
>>  support/scripts/apply-patches.sh | 3 +++
>>  1 file changed, 3 insertions(+)
> 
> In fact, this broke many packages, so I reverted.

Ok, sorry about that :-/

Romain

> 
> Thomas
>
diff mbox

Patch

diff --git a/support/scripts/apply-patches.sh b/support/scripts/apply-patches.sh
index 694302d..11fa5bf 100755
--- a/support/scripts/apply-patches.sh
+++ b/support/scripts/apply-patches.sh
@@ -31,6 +31,9 @@ 
 # applied. The list of the patches applied is stored in '.applied_patches_list'
 # file in the build directory.
 
+# We want to catch any unexpected failure, and exit immediately.
+set -e
+
 silent=
 if [ "$1" = "-s" ] ; then
     # add option to be used by the patch tool