Re: Unportable use of uname in pg_upgrade test script

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: Unportable use of uname in pg_upgrade test script
Дата
Msg-id 506730FD.4010605@dunslane.net
обсуждение исходный текст
Ответ на Re: Unportable use of uname in pg_upgrade test script  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Unportable use of uname in pg_upgrade test script  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Unportable use of uname in pg_upgrade test script  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
On 09/29/2012 01:06 PM, Tom Lane wrote:
> Andrew Dunstan <andrew@dunslane.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




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Unportable use of uname in pg_upgrade test script
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Unportable use of uname in pg_upgrade test script