From owner-svn-ports-head@freebsd.org Sat Nov 3 12:04:47 2018 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9B6F710FBE7B; Sat, 3 Nov 2018 12:04:47 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 534587F843; Sat, 3 Nov 2018 12:04:47 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from atuin.in.mat.cc (unknown [IPv6:2a01:678:42:ffff:3e15:c2ff:fec4:452e]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: mat/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id A33982617F; Sat, 3 Nov 2018 12:04:46 +0000 (UTC) (envelope-from mat@FreeBSD.org) Date: Sat, 3 Nov 2018 13:04:42 +0100 From: Mathieu Arnold To: Mathieu Arnold , ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: Re: svn commit: r483437 - in head/mail/dovecot: . files Message-ID: <20181103120442.moqlg4sjv4iezd7x@atuin.in.mat.cc> References: <201810292328.w9TNSRHm018030@repo.freebsd.org> <20181031150252.p4lhmlaposwurdgr@ogg.in.absolight.net> <20181102214147.3j4jf4bdujgaijjp@ler-imac.local> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="3aklw3o4rhsskaxn" Content-Disposition: inline In-Reply-To: <20181102214147.3j4jf4bdujgaijjp@ler-imac.local> User-Agent: NeoMutt/20180716 X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2018 12:04:47 -0000 --3aklw3o4rhsskaxn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Nov 02, 2018 at 04:41:47PM -0500, Larry Rosenman wrote: > On Wed, Oct 31, 2018 at 04:02:52PM +0100, Mathieu Arnold wrote: > > On Mon, Oct 29, 2018 at 11:28:27PM +0000, Larry Rosenman wrote: > > > Modified: head/mail/dovecot/files/dovecot.in > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > > --- head/mail/dovecot/files/dovecot.in Mon Oct 29 23:25:58 2018 (r483= 436) > > > +++ head/mail/dovecot/files/dovecot.in Mon Oct 29 23:28:26 2018 (r483= 437) > > > @@ -60,6 +60,14 @@ for config in ${dovecot_config}; do > > > required_files=3D"${config}" > > > command_args=3D"-c ${config}" > > > if [ -s ${config} ]; then > > > + ${command} ${command_args} -a 2>/dev/null > > > + if [ $? -ne 0 ]; then > >=20 > > Never test for $?. This should be: I should have said "never test for $? (not) being 0". > >=20 > > if ${command} ${command_args} -a 2>/dev/null; then > >=20 > > All the rationale in https://github.com/koalaman/shellcheck/wiki/SC2181. > But, for my own interest, what if I want to put out what the return code > is in a message? Shell is pretty limited in term of error control. You can write: if foo; then # Before anything else, save $? error=3D$? # do stuff and use $error when needed. fi Note that $? can get cloberred by many other things that the command you run, it can be a redirection error, a shell syntax error in the command in = the if, almost too many things to count. --=20 Mathieu Arnold --3aklw3o4rhsskaxn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAABCgB9FiEEOraXidLtEhBkQLpbOkUW81GDzkgFAlvdjtpfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNB QjY5Nzg5RDJFRDEyMTA2NDQwQkE1QjNBNDUxNkYzNTE4M0NFNDgACgkQOkUW81GD zkiMIBAApI9aCn6IutA7FCKut4o4uxCpH5Jv2YXTqAh06T+9z3efBGyWSkV0NBP/ qHr5OE3g30uB7TJdqHUg2vgUIkXiJ1tM4AgyJaV01F4WdWTA/xnaCSz9fO06Dnok KQbOsqQKFLw24wlpXocKhJ84nBbyfnxlXa0eJuX01zH+NgkQY/4YOpfKKP2AmcUs 6jaImVAOlDnfgZMhCxXt2zSCz5nKFB/LWLI8K50KjDXLNdoNvt0bh3FrImXMN3mL gjxHfwdwrY15AC7wS0cDPj4QI5HFOaoryNk/x0PQY+sq1XnQVaTP0GwhRHoh1hlH ga74pQLWQtMlr5/yWwqP/587zFpmSOvBAcDAwgy0rOWLkkon9YYyIxDKXRbULaFj c9dVbRxIESNb92tN+sZlJUomI/Dh3X/CbOWsq9OFT4UjZqMh7fgWhoKku+RqvBmx UfSiREPJvzN0DOynSno21JJOEqHaTXwXvNixeM7NMw8VemsfOcxKY9E5wLY1rBxc 9+9ZB0PKy+06Jm9/EskqOSd4hx6YlM3Hyy1FX59SMqkTI7fz9JpFEaQVrSaz1CEn lwSc+eA4IyEsyTNoX2GNIOdhw7ZYkNkg2ESjxhBJ+rM5n95hB3NLMcdo98AxJ6BP jUp7Aps+anggKI0SMPokEH+a5Sxia50Zvikhro9IY8HNR7R2r+A= =Pj2/ -----END PGP SIGNATURE----- --3aklw3o4rhsskaxn--