All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/6] travis-ci: use correct exit code on errors
Date: Thu, 27 Oct 2016 06:21:11 +0200	[thread overview]
Message-ID: <581180B7.9020508@denx.de> (raw)
In-Reply-To: <20161026170536.2367-2-swarren@wwwdotorg.org>

Hello Stephen,

Am 26.10.2016 um 19:05 schrieb Stephen Warren:
> From: Stephen Warren <swarren@nvidia.com>
>
> The phrase "if [ $? -ne 0 ]; then exit $?; fi" doesn't work correctly;
> by the time the "exit" statement runs, $? has already been over-written
> by the result of the [ command. Fix this by explicitly storing $? and
> then using that stored value in both the test and the error-case exit
> statement.
>
> This change also converts from textual comparison to integer comparison,
> since the exit code is an integer and there's no need to convert it to
> a string for comparison.
>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
>   .travis.yml | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)

Thanks!

Reviewed-by: Heiko Schocher <hs@denx.de>

bye,
Heiko

>
> diff --git a/.travis.yml b/.travis.yml
> index f91e1bc271fe..33685ce14777 100644
> --- a/.travis.yml
> +++ b/.travis.yml
> @@ -70,11 +70,12 @@ script:
>    - if [[ "${BUILDMAN}" != "" ]]; then
>        set +e;
>        tools/buildman/buildman ${BUILDMAN};
> -     if [[ "$?" == "0" || "$?" == "129" ]]; then
> +     ret=$?;
> +     if [[ $ret -eq 0 || $ret -eq 129 ]]; then
>          exit 0;
>        else
> -       exit $?;
> -     fi
> +       exit $ret;
> +     fi;
>      fi
>
>   matrix:
>

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

  reply	other threads:[~2016-10-27  4:21 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-26 17:05 [U-Boot] [PATCH 1/6] travis-ci: Use = not : when writing ~/.buildman Stephen Warren
2016-10-26 17:05 ` [U-Boot] [PATCH 2/6] travis-ci: use correct exit code on errors Stephen Warren
2016-10-27  4:21   ` Heiko Schocher [this message]
2016-10-29 17:41   ` [U-Boot] [U-Boot, " Tom Rini
2016-10-26 17:05 ` [U-Boot] [PATCH 3/6] travis-ci: centralize ~/.buildman editing Stephen Warren
2016-10-27  4:21   ` Heiko Schocher
2016-10-29 17:41   ` [U-Boot] [U-Boot, " Tom Rini
2016-10-26 17:05 ` [U-Boot] [PATCH 4/6] travis-ci: use buildman -P everywhere Stephen Warren
2016-10-27  4:22   ` Heiko Schocher
2016-10-29 17:41   ` [U-Boot] [U-Boot,4/6] " Tom Rini
2016-10-26 17:05 ` [U-Boot] [PATCH 5/6] travis-ci: don't invoke exit on success Stephen Warren
2016-10-27  6:12   ` Heiko Schocher
2016-10-29 17:41   ` [U-Boot] [U-Boot,5/6] " Tom Rini
2016-10-26 17:05 ` [U-Boot] [PATCH 6/6] travis-ci: compile with buildman when running test/py Stephen Warren
2016-10-26 18:56   ` Stephen Warren
2016-10-26 18:59   ` Tom Rini
2016-10-26 19:04     ` Stephen Warren
2016-10-27  6:13   ` Heiko Schocher
2016-10-29 17:41   ` [U-Boot] [U-Boot, " Tom Rini
2016-10-27  4:20 ` [U-Boot] [PATCH 1/6] travis-ci: Use = not : when writing ~/.buildman Heiko Schocher
2016-10-29 17:41 ` [U-Boot] [U-Boot, " Tom Rini

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=581180B7.9020508@denx.de \
    --to=hs@denx.de \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.