From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35698) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMamv-0007G5-MN for qemu-devel@nongnu.org; Mon, 11 Jul 2016 08:58:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bMamp-0002xn-RI for qemu-devel@nongnu.org; Mon, 11 Jul 2016 08:58:16 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58695) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMamp-0002xe-JH for qemu-devel@nongnu.org; Mon, 11 Jul 2016 08:58:11 -0400 References: <1468207242-5015-1-git-send-email-famz@redhat.com> <1468207242-5015-3-git-send-email-famz@redhat.com> From: Eric Blake Message-ID: <578397E1.9030008@redhat.com> Date: Mon, 11 Jul 2016 06:58:09 -0600 MIME-Version: 1.0 In-Reply-To: <1468207242-5015-3-git-send-email-famz@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="rjpKCknnVnMVwnpIHp3pc7GBvPbKCLOsO" Subject: Re: [Qemu-devel] [PATCH RFC v4 2/4] docker: Fix exit code if $CMD failed List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Fam Zheng , qemu-devel@nongnu.org Cc: alex.bennee@linaro.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --rjpKCknnVnMVwnpIHp3pc7GBvPbKCLOsO From: Eric Blake To: Fam Zheng , qemu-devel@nongnu.org Cc: alex.bennee@linaro.org Message-ID: <578397E1.9030008@redhat.com> Subject: Re: [Qemu-devel] [PATCH RFC v4 2/4] docker: Fix exit code if $CMD failed References: <1468207242-5015-1-git-send-email-famz@redhat.com> <1468207242-5015-3-git-send-email-famz@redhat.com> In-Reply-To: <1468207242-5015-3-git-send-email-famz@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 07/10/2016 09:20 PM, Fam Zheng wrote: > Signed-off-by: Fam Zheng > --- > tests/docker/run | 4 ++++ > 1 file changed, 4 insertions(+) >=20 > diff --git a/tests/docker/run b/tests/docker/run > index 575e732..38ce789 100755 > --- a/tests/docker/run > +++ b/tests/docker/run > @@ -11,6 +11,8 @@ > # or (at your option) any later version. See the COPYING file in > # the top-level directory. > =20 > +set -e > + 'set -e' is a crutch that often does not do what you naively expect. In particular, it interacts very poorly with shell functions; if 'f' is a shell function, running 'f' is different than running 'f || alternate', in whether the body of 'f' will exit early. I'd much rather script without having to think about whether 'set -e' is doing the right thing, because it usually isn't. > if test -n "$V"; then > set -x > fi > @@ -61,4 +63,6 @@ elif test -n "$DEBUG"; then > echo > # Force error after shell exits > $SHELL && exit 1 > +else > + exit 1 > fi >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --rjpKCknnVnMVwnpIHp3pc7GBvPbKCLOsO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJXg5fhAAoJEKeha0olJ0NqAjgH/1q0QNTIxh4ZpXUF8OxwntbU eVySNKRYC09gvKs1bNYrCy6SDw1I3uikXU5wBXCIdnbr69sJ0dKaCMlCh9P5Z4Dn htu13G9HIerQ5cOUfcfsOd8Mv7vQoDMur2bUdUxg69zJ4Ss+n85kibmOj7GaD0Py 2yg8BoTIeVS8MWxa4ikv99KUHQy0GB8ebCdhhqhrd06LIgw+ZZFjNpIgbqpXAjwD DNEdRspylLpqaUKFjIgeLoqFt2y6f1LIx38de7TQ+42ofrC9Ecutixvh7k1xqCae aJU3gKck9Tvu/g8MzJGK103Bp+wwXnYXPfpoeErzasI1QAW7cHDnSRUICdyz0fw= =2LmN -----END PGP SIGNATURE----- --rjpKCknnVnMVwnpIHp3pc7GBvPbKCLOsO--