From owner-svn-src-all@FreeBSD.ORG Tue Jan 11 07:27:09 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24F041065694; Tue, 11 Jan 2011 07:27:09 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id B0ED78FC18; Tue, 11 Jan 2011 07:27:07 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id 45DEC45C9B; Tue, 11 Jan 2011 08:27:06 +0100 (CET) Received: from localhost (89-73-192-49.dynamic.chello.pl [89.73.192.49]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id 2C40145684; Tue, 11 Jan 2011 08:27:01 +0100 (CET) Date: Tue, 11 Jan 2011 08:26:53 +0100 From: Pawel Jakub Dawidek To: Garrett Cooper Message-ID: <20110111072653.GD1923@garage.freebsd.pl> References: <201101101911.p0AJBQKG090310@svn.freebsd.org> <20110110220957.GB1923@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6zdv2QT/q3FMhpsV" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-0.6 required=4.5 tests=BAYES_00,RCVD_IN_SORBS_DUL autolearn=no version=3.0.4 Cc: Josh Paetzel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217229 - head/usr.sbin/pc-sysinstall/backend X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jan 2011 07:27:09 -0000 --6zdv2QT/q3FMhpsV Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Jan 10, 2011 at 03:52:12PM -0800, Garrett Cooper wrote: > >> + =A0 =A0 =A0 =A0if [ "${FS}" !=3D "UFS" -a "${FS}" !=3D "UFS+S" -a "$= {FS}" !=3D "UFS+J" -a "${FS}" !=3D "UFS+SUJ" ] ; then > > > > Something like this should work too: > > > > =A0 =A0 =A0 =A0if [ "${FS%+*}" !=3D "UFS" ]; then >=20 > Except they're catching less than that: >=20 > $ FS=3DUFS+FOO > $ echo ${FS%+*} > UFS > $ You mean that invalid ${FS} values are catched? The code as it is don't handle them too. I expect those are handled somewhere earlier. From my understanding the code wants to dected if this is any configuration of UFS, so in my opinion my version is better as there are no modifications needed if some other UFS variant will appear in the future. > >> + =A0if [ "$?" !=3D "0" ] ; then return ; fi > > > > [ $? -eq 0 ] || return >=20 > if [ $? -eq 0 ]; then > return > fi In that case -ne, as you reverted the logic. > is easier to follow for me because more people go buckwild with the > one-liners (and in some cases have introduced bugs that way because > they didn't properly think about precedence of the operations, etc). I kinda started to like very simple and obvious one-liners in sh(1), but this is just a matter of taste. > The one-line above if ... fi above is ugly though. Agreed. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --6zdv2QT/q3FMhpsV Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk0sBj0ACgkQForvXbEpPzQtPQCgo80xCU4yjvu4GxWqUSKwMlQQ GmsAoNBz8dnXOtwfM4acA9/Kp/MB1U+8 =CLtd -----END PGP SIGNATURE----- --6zdv2QT/q3FMhpsV--