Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Romain Naour <romain.naour@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 1/1] support/scripts/apply-patches.sh: handle tar and mkdir failures
Date: Tue, 5 Jul 2016 13:05:26 +0200	[thread overview]
Message-ID: <a6707437-fd76-c538-3e21-eceaff76976e@gmail.com> (raw)
In-Reply-To: <1464178439-3333-1-git-send-email-sebastien.szymanski@armadeus.com>

Hi S?bastien,

Le 25/05/2016 ? 14:13, S?bastien Szymanski a ?crit :
> With several archives in a space-separated list of patches, if one archive
> cannot be untar (i.e because it is not readable), Buildroot keeps going instead
> of aborting. Fix this by checking the tar return code.
> While at it, check if the unpack archive directory creation is successful.

As discussed with other Buildroot developers, we prefer to use "set -e" in
apply-patches.sh

See:
http://patchwork.ozlabs.org/patch/644705

I'll mark you patch rejected in patchwork.

Thanks!

Best regards,
Romain


> 
> Signed-off-by: S?bastien Szymanski <sebastien.szymanski@armadeus.com>
> ---
>  support/scripts/apply-patches.sh | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/support/scripts/apply-patches.sh b/support/scripts/apply-patches.sh
> index 201278d..b0a8ad4 100755
> --- a/support/scripts/apply-patches.sh
> +++ b/support/scripts/apply-patches.sh
> @@ -132,7 +132,11 @@ function scan_patchdir {
>                  unpackedarchivedir="$builddir/.patches-$(basename $i)-unpacked"
>                  rm -rf "$unpackedarchivedir" 2> /dev/null
>                  mkdir "$unpackedarchivedir"
> -                tar -C "$unpackedarchivedir" -xaf "${path}/$i"
> +                if [ $? != 0 ] ; then
> +                    echo "Error: cannot create $unpackedarchivedir directory."
> +                    exit 1
> +                fi
> +                tar -C "$unpackedarchivedir" -xaf "${path}/$i" || exit 1
>                  scan_patchdir "$unpackedarchivedir"
>              else
>                  apply_patch "$path" "$i"
> 

      parent reply	other threads:[~2016-07-05 11:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-25 12:13 [Buildroot] [PATCH 1/1] support/scripts/apply-patches.sh: handle tar and mkdir failures Sébastien Szymanski
2016-05-25 15:11 ` Thomas Petazzoni
2016-05-25 16:04   ` Sébastien Szymanski
2016-07-05 10:40 ` Romain Naour
2016-07-05 11:05 ` Romain Naour [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a6707437-fd76-c538-3e21-eceaff76976e@gmail.com \
    --to=romain.naour@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox