Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 May 2012 09:33:38 -0700
From:      Garrett Cooper <yanegomi@gmail.com>
To:        Josh Paetzel <jpaetzel@FreeBSD.org>
Cc:        "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "src-committers@freebsd.org" <src-committers@freebsd.org>, "kmoore@freebsd.org" <kmoore@freebsd.org>
Subject:   Re: svn commit: r235005 - head/usr.sbin/pc-sysinstall/backend
Message-ID:  <F68AFF89-B9C3-494B-8B61-7130999BC354@gmail.com>
In-Reply-To: <201205041531.q44FVaYF010236@svn.freebsd.org>
References:  <201205041531.q44FVaYF010236@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On May 4, 2012, at 8:31 AM, Josh Paetzel <jpaetzel@FreeBSD.org> wrote:

> 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:27:1=
8 2012    (r235004)
> +++ head/usr.sbin/pc-sysinstall/backend/functions.sh    Fri May  4 15:31:3=
5 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))

Bug; should be '$SIZE/'

>   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

while :
do

Is better.

> +      NEWNAME=3D"${BASENAME}${NUM}"
> +      zpool import | grep -q "${NEWNAME}"
> +      if [ $? -ne 0 ] ; then break ; fi

Please decompress the conditional.

> +      NUM=3D$((NUM+1))

Another bug (see above).

Thanks,
-Garrett=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F68AFF89-B9C3-494B-8B61-7130999BC354>