pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nikolay Shaplov <dhyan@nataraj.su>
To: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@lists.postgresql.org, Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Витус Вагнер <vitus@wagner.pp.ru>
Subject: Re: [PATCH] check for ctags utility in make_ctags
Date: Mon, 07 Jan 2019 20:42:35 +0300
Message-ID: <19586606.0NixFSG4dh@x200m> (raw)
In-Reply-To: <249c110c-1a30-87bf-2bb8-bc84265c1eeb@2ndQuadrant.com>
References: <2394207.ccz7JgCJsh@x200m>
	<5709.1546794967@sss.pgh.pa.us>
	<249c110c-1a30-87bf-2bb8-bc84265c1eeb@2ndQuadrant.com>

В письме от воскресенье, 6 января 2019 г. 17:50:36 MSK пользователь Andrew 
Dunstan написал:

> > 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;}

If it is good enough for you, then is is good for me for sure...
Imported it to the patch.



Attachments:

  [text/x-patch] check-for-ctags-in-make_ctags_v5.diff (730B, ../19586606.0NixFSG4dh@x200m/2-check-for-ctags-in-make_ctags_v5.diff)
  download | inline diff:
diff --git a/.gitignore b/.gitignore
index 794e35b..2dfbbe1 100644
diff --git a/src/tools/make_ctags b/src/tools/make_ctags
index 1609c07..1e71692 100755
--- a/src/tools/make_ctags
+++ b/src/tools/make_ctags
@@ -2,6 +2,9 @@
 
 # src/tools/make_ctags
 
+command -v ctags >/dev/null || \
+	{ echo "'ctags' utility is not found" 1>&2; exit 1;}
+
 trap "rm -f /tmp/$$" 0 1 2 3 15
 rm -f ./tags
 
diff --git a/src/tools/make_etags b/src/tools/make_etags
index 3ce96bc..6dc6710 100755
--- a/src/tools/make_etags
+++ b/src/tools/make_etags
@@ -2,6 +2,9 @@
 
 # src/tools/make_etags
 
+command -v etags >/dev/null || \
+	{ echo "'etags' utility is not found" 1>&2; exit 1;}
+
 rm -f ./TAGS
 
 find `pwd`/ -type f -name '*.[chyl]' -print |

view thread (14+ messages)  latest in thread

Message-ID: <19586606.0NixFSG4dh@x200m>
Permalink:  ../19586606.0NixFSG4dh@x200m/
Also on:    postgresql.org/message-id/19586606.0NixFSG4dh@x200m

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: dhyan@nataraj.su, andrew.dunstan@2ndquadrant.com, tgl@sss.pgh.pa.us, peter.eisentraut@2ndquadrant.com, michael@paquier.xyz, vitus@wagner.pp.ru
  Subject: Re: [PATCH] check for ctags utility in make_ctags
  In-Reply-To: <19586606.0NixFSG4dh@x200m>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox