Date: Mon, 10 Jan 2011 23:59:47 -0800 From: Garrett Cooper <yanegomi@gmail.com> To: Pawel Jakub Dawidek <pjd@FreeBSD.org> Cc: Josh Paetzel <jpaetzel@freebsd.org>, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Garrett Cooper <gcooper@FreeBSD.org> Subject: Re: svn commit: r217229 - head/usr.sbin/pc-sysinstall/backend Message-ID: <7533FEDE-01C5-4939-85B9-35289A1BD95B@gmail.com> In-Reply-To: <20110111072653.GD1923@garage.freebsd.pl> References: <201101101911.p0AJBQKG090310@svn.freebsd.org> <20110110220957.GB1923@garage.freebsd.pl> <AANLkTimewVu2s5rCoJtD7E5d_tjFsoGHvuHb7rqNpsEO@mail.gmail.com> <20110111072653.GD1923@garage.freebsd.pl>
next in thread | previous in thread | raw e-mail | index | archive | help
On Jan 10, 2011, at 11:26 PM, Pawel Jakub Dawidek wrote:
> On Mon, Jan 10, 2011 at 03:52:12PM -0800, Garrett Cooper wrote:
>>>> + if [ "${FS}" != "UFS" -a "${FS}" != "UFS+S" -a "${FS}" != "UFS+J" -a "${FS}" != "UFS+SUJ" ] ; then
>>>
>>> Something like this should work too:
>>>
>>> if [ "${FS%+*}" != "UFS" ]; then
>>
>> Except they're catching less than that:
>>
>> $ FS=UFS+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.
Better for reducing churn, not better for user input; user input will always ding you in the long run because users can do interesting things :/...
>>>> + if [ "$?" != "0" ] ; then return ; fi
>>>
>>> [ $? -eq 0 ] || return
>>
>> if [ $? -eq 0 ]; then
>> return
>> fi
>
> In that case -ne, as you reverted the logic.
Yeah, what you said :}...
>> 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.
I used to like one-liners in perl, but that gets nasty too after a while. It's much easier to trace indentations and track down what's going on IMO than it is to trace down one-liners. python I live with just because their one-liners can also be used for assignment purposes (which is the only case I use it with).
Thanks!
-Garrett
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7533FEDE-01C5-4939-85B9-35289A1BD95B>
