Re: [PATCH] check for ctags utility in make_ctags

From: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Nikolay Shaplov <dhyan(at)nataraj(dot)su>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Витус Вагнер <vitus(at)wagner(dot)pp(dot)ru>
Subject: Re: [PATCH] check for ctags utility in make_ctags
Date: 2019-01-06 22:50:36
Message-ID: 249c110c-1a30-87bf-2bb8-bc84265c1eeb@2ndQuadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 1/6/19 12:16 PM, Tom Lane wrote:
>
> The correct way to code this is to depend on the exit code,
> not the text output:
>
> if command -v etags >/dev/null
> then
> : ok
> else
> echo etags not found
> exit 1
> fi

more succinctly,

command -v etags >/dev/null || { echo etags not found; exit 1;}

 

> We could alternatively try to use "which" in the same way,
> but I'm dubious that it's more portable than "command".
> (AFAICT, "which" is *not* in POSIX.)
>
>

Indeed. I know I have some systems where it's lacking.

cheers

andrew

--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-01-06 23:16:07 Re: Python versions (was Re: RHEL 8.0 build)
Previous Message Andrew Dunstan 2019-01-06 22:40:16 Re: BUG #15446: Crash on ALTER TABLE