Re: Unportable use of uname in pg_upgrade test script

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Unportable use of uname in pg_upgrade test script
Date: 2012-09-29 17:33:49
Message-ID: 506730FD.4010605@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


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

> And why would that fix it? The
> output of -a is *defined* to be the same as -s followed by other stuff.
> The reference page I'm looking at also points out that the -s string
> can contain embedded blanks.

Exactly, the sed script pulls the last token from the line, which is
Msys on all my Mingw systems.

If you want to do it another way we could possibly pass the PORTNAME
from the global make file.

cheers

andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-09-29 17:46:27 Re: Unportable use of uname in pg_upgrade test script
Previous Message Tom Lane 2012-09-29 17:06:12 Re: Unportable use of uname in pg_upgrade test script