Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 Jan 2011 08:26:53 +0100
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        Garrett Cooper <gcooper@FreeBSD.org>
Cc:        Josh Paetzel <jpaetzel@freebsd.org>, 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
Message-ID:  <20110111072653.GD1923@garage.freebsd.pl>
In-Reply-To: <AANLkTimewVu2s5rCoJtD7E5d_tjFsoGHvuHb7rqNpsEO@mail.gmail.com>
References:  <201101101911.p0AJBQKG090310@svn.freebsd.org> <20110110220957.GB1923@garage.freebsd.pl> <AANLkTimewVu2s5rCoJtD7E5d_tjFsoGHvuHb7rqNpsEO@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110111072653.GD1923>