AF:
NF:0
PS:10
SRH:1
SFN:
DSR:
MID:<20071108081332.0b99f693@ripper.onstor.net>
CFG:
PT:0
S:andy.sharp@onstor.com
RQ:
SSV:onstor-exch02.onstor.net
NSV:
SSH:
R:<ed.kwan@onstor.com>,<brian.nguyen@onstor.com>
MAID:1
X-Sylpheed-Privacy-System:
X-Sylpheed-Sign:0
SCF:#mh/Mailbox/sent
RMID:#imap/andys@onstor.net@onstor-exch02.onstor.net/INBOX	0	BB375AF679D4A34E9CA8DFA650E2B04E067942A4@onstor-exch02.onstor.net
X-Sylpheed-End-Special-Headers: 1
Date: Thu, 8 Nov 2007 08:15:08 -0800
From: Andrew Sharp <andy.sharp@onstor.com>
To: "Ed Kwan" <ed.kwan@onstor.com>
Cc: "Brian Nguyen" <brian.nguyen@onstor.com>
Subject: Re: EverON-3.1.0.5-install.sh
Message-ID: <20071108081508.456bb7c4@ripper.onstor.net>
In-Reply-To: <BB375AF679D4A34E9CA8DFA650E2B04E067942A4@onstor-exch02.onstor.net>
References: <BB375AF679D4A34E9CA8DFA650E2B04E067942A4@onstor-exch02.onstor.net>
Organization: Onstor
X-Mailer: Sylpheed-Claws 2.6.0 (GTK+ 2.8.20; x86_64-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

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=$1

	df -k | grep '^/dev' | while read dev sz used avail crack mpt ; do
		if [ "$mpt" = "$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=`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
> ==== //depot/dev/nfx-tree/Tools/cw_install.in#3 -
> /homes/edk/p4/dev/nfx-tree/Tools/cw_install.in ====
> ***************
> *** 465,470 ****
> --- 465,471 ----
>         df -k | grep '^/dev' | while read dev sz used avail crack
> mpt ; do
>                 if [ "$mpt" = "$fs" ] ; then
>                         echo $avail
> +                         break
>                 fi
>         done
>   }
> ***************
> *** 494,500 ****
>                         fi
>                 fi
>                 a=`get_free_space "$p"`
> !               if [ $a -gt $fkb ] ; then
>                         d=`expr $a - $fkb`
>                         if [ $d -ge 10240 ] ; then
>                                 # 10 MB is enough, we're out of here
> --- 495,501 ----
>                         fi
>                 fi
>                 a=`get_free_space "$p"`
> !               if [ "$a" -gt $fkb ] ; then
>                         d=`expr $a - $fkb`
>                         if [ $d -ge 10240 ] ; then
>                                 # 10 MB is enough, we're out of here
> 
> 
