Re: Unportable use of uname in pg_upgrade test script

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Unportable use of uname in pg_upgrade test script
Date: 2012-10-01 03:30:00
Message-ID: 1349062200.3584.26.camel@vanquo.pezone.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, 2012-09-29 at 13:33 -0400, Andrew Dunstan wrote:
> On 09/29/2012 01:06 PM, Tom Lane wrote:
> > Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
> >> The trouble with uname -s is that its output is a bit variable. I think
> >> this will work:
> >> testhost=`uname -a | sed 's/.* //'`
> > What do you mean by "a bit variable"?
>
> On one of my machines uname -s return MINGW32_NT5.1
>
> On another it says MINGW32_NT6.1

You could do

case $testhost in
MINGW*) something;;

Or call config.guess, which exists more or less for this purpose.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Dan Scott 2012-10-01 03:35:42 Re: Doc patch, normalize search_path in index
Previous Message Dan Scott 2012-10-01 03:04:24 Re: Extending range of to_tsvector et al