X-MimeOLE: Produced By Microsoft Exchange V6.5
Received: by onstor-exch02.onstor.net 
	id <01C8224A.9BF19523@onstor-exch02.onstor.net>; Thu, 8 Nov 2007 13:02:01 -0800
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Content-class: urn:content-classes:message
Subject: RE: EverON-3.1.0.5-install.sh
Date: Thu, 8 Nov 2007 13:02:01 -0800
Message-ID: <BB375AF679D4A34E9CA8DFA650E2B04E0679466A@onstor-exch02.onstor.net>
In-Reply-To: <20071108115916.1c06365e@ripper.onstor.net>
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
Thread-Topic: EverON-3.1.0.5-install.sh
Thread-Index: AcgiQdgxMXOodxI5S0mHt/1jaOExwgAB2CPg
References: <BB375AF679D4A34E9CA8DFA650E2B04E067942A4@onstor-exch02.onstor.net><20071108081508.456bb7c4@ripper.onstor.net><BB375AF679D4A34E9CA8DFA650E2B04E06794503@onstor-exch02.onstor.net> <20071108115916.1c06365e@ripper.onstor.net>
From: "Ed Kwan" <ed.kwan@onstor.com>
To: "Andy Sharp" <andy.sharp@onstor.com>
Cc: "Brian Nguyen" <brian.nguyen@onstor.com>

Tried that too, and doesn't work.  The variable is changed within the
scope of the while-loop only, and it remains 0 within the function.=20

Already told CS not to use the script when upgrading from 3.x to 3.x.
Maybe we should enforce that?  Need to discuss with QA & CS.

> -----Original Message-----
> From: Andy Sharp
> Sent: Thursday, November 08, 2007 11:59 AM
> To: Ed Kwan
> Cc: Brian Nguyen
> Subject: Re: EverON-3.1.0.5-install.sh
>=20
> On Thu, 8 Nov 2007 10:28:20 -0800 "Ed Kwan" <ed.kwan@onstor.com>
wrote:
>=20
> > Hi Andy,
> >
> > Well, customers are using it to upgrade from 3.x to 3.x.  Whether
> > it's a bug or ECR or PVR, it's giving Brian and me headaches.
>=20
> Sorry to hear that it's giving you headaches.  Can't we just
> pull it except for the release it was intended for?
>=20
> > Before I sent you the email yesterday evening, I wasted 1/2 hr
trying
> > similar code change you suggested, and it didn't work:
>=20
> Even more sorry to hear that.
>=20
> Well, what a PoS this shell is then.  How about adding a variable,
such
> as
>=20
> avail=3D0
> df | grep | while read dev pavail ; do
>     if [ "$mpt" =3D "$fs" ] ; then
>         avail=3D$pavail
>         break
>     fi
> done
> echo $avail
>=20
>=20
> You can also add the quoting in the other routine, it can only help.
>=20
> > eng236# cat s1
> > #!/bin/sh
> >
> > get_free_space() {
> >         set -vx
> >         fs=3D$1
> >
> >         df -k | grep '^/dev' | while read dev sz used avail crack
> > mpt ; do
> >                         echo $dev $avail
> >                         return
> >                         echo "after return"
> >         done
> >         echo "should not reach"
> > }
> >
> > p=3D"/ /tmp"
> > a=3D`get_free_space "$p"`
> > echo a is $a
> >
> > eng236# ./s1
> > + fs=3D/ /tmp
> > + df -k
> > + grep ^/dev
> > + read dev sz used avail crack mpt
> > + echo /dev/wd1a 29692
> > + return
> > + echo should not reach
> > a is /dev/wd1a 29692 should not reach
> >
> > The "return" statement causes the while-loop to exit, but we
continue
> > execution in get_free_space().
> >
> > Ed
> >
> >
> > > -----Original Message-----
> > > From: Andy Sharp
> > > Sent: Thursday, November 08, 2007 8:15 AM
> > > To: Ed Kwan
> > > Cc: Brian Nguyen
> > > Subject: Re: EverON-3.1.0.5-install.sh
> > >
> > > On Wed, 7 Nov 2007 19:27:52 -0800 "Ed Kwan" <ed.kwan@onstor.com>
> > wrote:
> > >
> > > > Hi Andy,
> > >
> > > Hi Eric,
> > >
> > > > While researching TED 20993, I noticed a bug in the EverON
install
> > > > script.  When a customer use it on a 3.x system,
/usr/local/agile
> > and
> > > > /usr don't exist, so get_free_space() won't echo any numbers.
> > > > This causes a syntax error in line 497:
> > >
> > > First of all, let's get something straight.  It's not a bug in the
> > > script, as the requirements for the script never included this
use,
> > > ie., upgrading from a 3.x to something else.  Customers should
> > > really use upgrade.
> > >
> > > Phew, now that we have that major issue straightened out, on to
the
> > > next part.
> > >
> > > What is bug 20993?
> > >
> > > You do have /usr and /usr/local/agile, if you are on a system the
> > script
> > > was designed to run on, so you need to take a good long look at
this
> > > script to see where else there might be parts that expect similar
> > > circumstances; there may actually be quite a few.
> > >
> > > Of course, you could just assign the bug to me^H^HLarry.
> > >
> > > Or just change get_free_space thusly:
> > >
> > > get_free_space() {
> > > 	fs=3D$1
> > >
> > > 	df -k | grep '^/dev' | while read dev sz used avail crack
> > > mpt ;
> > do
> > > 		if [ "$mpt" =3D "$fs" ] ; then
> > > 			echo $avail
> > > 			return
> > > 		fi
> > > 	done
> > > 	echo 0
> > > }
> > >
> > > Cheers,
> > >
> > > a
> > >
> > > >     475 findspace() {
> > > >
> > > >     481         # find the biggest chunk of free space
> > > >     482         for p in / /usr /usr/local/agile /var ; do
> > > >
> > > >     496                 a=3D`get_free_space "$p"`
> > > >     497                 if [ $a -gt $fkb ] ; then, and
> > > >
> > > > Here are my proposed changes.  Please review.
> > > >
> > > > Thanks,
> > > > Ed
> > > >
> > > > [edk@edk-linux Tools]$ p4 diff -dc
> > > > =3D=3D=3D=3D //depot/dev/nfx-tree/Tools/cw_install.in#3 -
> > > > /homes/edk/p4/dev/nfx-tree/Tools/cw_install.in =3D=3D=3D=3D
> > > > ***************
> > > > *** 465,470 ****
> > > > --- 465,471 ----
> > > >         df -k | grep '^/dev' | while read dev sz used avail
crack
> > > > mpt ; do
> > > >                 if [ "$mpt" =3D "$fs" ] ; then
> > > >                         echo $avail
> > > > +                         break
> > > >                 fi
> > > >         done
> > > >   }
> > > > ***************
> > > > *** 494,500 ****
> > > >                         fi
> > > >                 fi
> > > >                 a=3D`get_free_space "$p"`
> > > > !               if [ $a -gt $fkb ] ; then
> > > >                         d=3D`expr $a - $fkb`
> > > >                         if [ $d -ge 10240 ] ; then
> > > >                                 # 10 MB is enough, we're out of
> > > > here --- 495,501 ----
> > > >                         fi
> > > >                 fi
> > > >                 a=3D`get_free_space "$p"`
> > > > !               if [ "$a" -gt $fkb ] ; then
> > > >                         d=3D`expr $a - $fkb`
> > > >                         if [ $d -ge 10240 ] ; then
> > > >                                 # 10 MB is enough, we're out of
> > > > here
> > > >
> > > >
