From owner-svn-src-head@FreeBSD.ORG Fri May 4 18:22:04 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AD30C1065670; Fri, 4 May 2012 18:22:04 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 8B3DF8FC0A; Fri, 4 May 2012 18:22:04 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q44IM43i082553; Fri, 4 May 2012 18:22:04 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q44IM4ET082552; Fri, 4 May 2012 18:22:04 GMT (envelope-from bapt@FreeBSD.org) X-Authentication-Warning: freefall.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f Date: Fri, 4 May 2012 20:22:00 +0200 From: Baptiste Daroussin To: Garrett Cooper Message-ID: <20120504182200.GD1604@azathoth.lan> References: <201205041531.q44FVaYF010236@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="bajzpZikUji1w+G9" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Josh Paetzel , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , "kmoore@freebsd.org" Subject: Re: svn commit: r235005 - 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: Fri, 04 May 2012 18:22:04 -0000 --bajzpZikUji1w+G9 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, May 04, 2012 at 09:33:38AM -0700, Garrett Cooper wrote: > On May 4, 2012, at 8:31 AM, Josh Paetzel wrote: >=20 > > Author: jpaetzel > > Date: Fri May 4 15:31:35 2012 > > New Revision: 235005 > > URL: http://svn.freebsd.org/changeset/base/235005 > >=20 > > Log: > > Use a unique zpool name during install, in the case of having another > > PC-BSD / FreeBSD zpool on the system for another install. > >=20 > > Submitted by: kmoore > > Obtained from: PC-BSD > > MFC after: 3 days > > Sponsored by: iXsystems > >=20 > > Modified: > > head/usr.sbin/pc-sysinstall/backend/functions.sh > >=20 > > Modified: head/usr.sbin/pc-sysinstall/backend/functions.sh > > =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/usr.sbin/pc-sysinstall/backend/functions.sh Fri May 4 15:2= 7:18 2012 (r235004) > > +++ head/usr.sbin/pc-sysinstall/backend/functions.sh Fri May 4 15:3= 1:35 2012 (r235005) > > @@ -216,7 +216,7 @@ fetch_file() > >=20 > > fetch -s "${FETCHFILE}" >${SIZEFILE} > > SIZE=3D"`cat ${SIZEFILE}`" > > - SIZE=3D"`expr ${SIZE} / 1024`" > > + SIZE=3D$((SIZE/1024)) >=20 > Bug; should be '$SIZE/' No this is perfectly valid >=20 > > echo "FETCH: ${FETCHFILE}" > > echo "FETCH: ${FETCHOUTFILE}" >>${LOGOUT} > >=20 > > @@ -276,11 +276,22 @@ get_zpool_name() > > else > > # Need to generate a zpool name for this device > > NUM=3D`ls ${TMPDIR}/.zpools/ | wc -l | sed 's| ||g'` > > - NEWNAME=3D"${BASENAME}${NUM}" > > + > > + # Is it used in another zpool? > > + while > > + z=3D1 > > + do >=20 > while : > do >=20 > Is better. >=20 > > + NEWNAME=3D"${BASENAME}${NUM}" > > + zpool import | grep -q "${NEWNAME}" > > + if [ $? -ne 0 ] ; then break ; fi >=20 > Please decompress the conditional. or=20 zpool import | grep -q "${NEWNAME}" && break btw this is potentially buggy if there is a zpool named: a${NEWNAME}b for example zpool import | grep -qw "${NEWNAME}" && break should be perhaps better >=20 > > + NUM=3D$((NUM+1)) >=20 > Another bug (see above). >=20 > Thanks, > -Garrett --bajzpZikUji1w+G9 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAk+kHkgACgkQ8kTtMUmk6EwriACfTQPvFz9qT2HdxyQZUj3FA7zX N5oAoISZGfdLeNb1eUn41wHOke1rrjRG =oi4X -----END PGP SIGNATURE----- --bajzpZikUji1w+G9--