From owner-svn-src-head@FreeBSD.ORG Tue Jan 11 07:59:54 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7D2E7106566C; Tue, 11 Jan 2011 07:59:54 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id BAA5B8FC0C; Tue, 11 Jan 2011 07:59:53 +0000 (UTC) Received: by iwn39 with SMTP id 39so20295896iwn.13 for ; Mon, 10 Jan 2011 23:59:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=XNi4djoeCWqphcyEX2DJDmn5Lu3rWwk0YM+O4oR7KY4=; b=HD54mXStiJ5SQ/juTyOKoCG767k2ZROyYAG5lI2ZZ/Xby337OKo/afbV2D51tt7b8V tu3TBf07pQPcPSmB4sQ23t4AJlirTtXv0hZ1MJz6hTaJ3W67K9nFAEFNBDa7cXLoQkNe T1dosbRjG+UVMXeyDSZifIi89phupu+nCDdS4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=tFzXeFYKx+2qwymrsNuActwNELpz5T7X7i1EI/bfYSVZQLoaSWrtuZjw4eQQ+NEroN H7tf4fFllwTa1oKekycwT+TeM13vqbspnStfRwx+RGc0gZj2KzNivyEbMq4WsPHbSGKV 1Dv5GV+ta8CptXWyuRdtQ7x9ppSEEI6RjpDoM= Received: by 10.42.174.200 with SMTP id w8mr5397524icz.376.1294732793398; Mon, 10 Jan 2011 23:59:53 -0800 (PST) Received: from [192.168.20.5] (c-24-130-151-210.hsd1.ca.comcast.net [24.130.151.210]) by mx.google.com with ESMTPS id y8sm4316862ica.2.2011.01.10.23.59.50 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 10 Jan 2011 23:59:52 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii From: Garrett Cooper In-Reply-To: <20110111072653.GD1923@garage.freebsd.pl> Date: Mon, 10 Jan 2011 23:59:47 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <7533FEDE-01C5-4939-85B9-35289A1BD95B@gmail.com> References: <201101101911.p0AJBQKG090310@svn.freebsd.org> <20110110220957.GB1923@garage.freebsd.pl> <20110111072653.GD1923@garage.freebsd.pl> To: Pawel Jakub Dawidek X-Mailer: Apple Mail (2.1082) Cc: Josh Paetzel , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Garrett Cooper Subject: Re: svn commit: r217229 - head/usr.sbin/pc-sysinstall/backend X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jan 2011 07:59:54 -0000 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}" !=3D "UFS" -a "${FS}" !=3D "UFS+S" -a "${FS}" = !=3D "UFS+J" -a "${FS}" !=3D "UFS+SUJ" ] ; then >>>=20 >>> Something like this should work too: >>>=20 >>> if [ "${FS%+*}" !=3D "UFS" ]; then >>=20 >> Except they're catching less than that: >>=20 >> $ FS=3DUFS+FOO >> $ echo ${FS%+*} >> UFS >> $ >=20 > 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. =46rom = 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 [ "$?" !=3D "0" ] ; then return ; fi >>>=20 >>> [ $? -eq 0 ] || return >>=20 >> if [ $? -eq 0 ]; then >> return >> fi >=20 > 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). >=20 > 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=