Re: Unportable use of uname in pg_upgrade test script - Mailing list pgsql-hackers

From Andrew Dunstan
Subject Re: Unportable use of uname in pg_upgrade test script
Date
Msg-id 5067235C.3000901@dunslane.net
Whole thread Raw
In response to Unportable use of uname in pg_upgrade test script  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Unportable use of uname in pg_upgrade test script  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 09/29/2012 12:13 PM, Tom Lane wrote:
> BTW, I tried the pg_upgrade regression tests this morning on my dinosaur
> HPUX box, and it promptly fell over with:
>
> uname: illegal option -- o
> usage: uname [-amnrsvil] [-S nodename]
> make: *** [check] Error 1
>
> This is not terribly surprising, because the -o option is nowhere to be
> seen in the Single Unix Spec definition of uname; which means this is
> likely to fail on other platforms too.  I would suggest using -s, or no
> option at all, or finding some other way to identify Windows/MSys.

The trouble with uname -s is that its output is a bit variable. I think 
this will work:
    testhost=`uname -a | sed 's/.* //'`


cheers

andrew




pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Unportable use of uname in pg_upgrade test script
Next
From: Andrew Dunstan
Date:
Subject: Re: is JSON really "a type" (Re: data to json enhancements)