Re: make_ctags: use -I option to ignore pg_node_attr macro

Fujii Masao <masao.fujii@oss.nttdata.com>

From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Tatsuo Ishii <ishii@sraoss.co.jp>, nagata@sraoss.co.jp, alvherre@alvh.no-ip.org, pgsql-hackers@postgresql.org
Date: 2023-02-08T10:29:40Z
Lists: pgsql-hackers

On 2023/02/08 9:49, Tatsuo Ishii wrote:
>>> I am not sure if this is good way to check if ctags supports "-e" or not.
>>>
>>> +	then	ctags --version 2>&1 | grep -- -e >/dev/null
>>>
>>> Perhaps, "--help" might be intended rather than "--version" to check
>>> supported options?
>>
>> Yeah, that was my mistake.
>>
>>>   Even so, ctags would have other option whose name contains
>>> "-e" than Emacs support, so this check could end in a wrong result.  Therefore,
>>> it seems to me that it is better to check immediately if etags is available
>>> in case that we don't have Exuberant-type ctags.
>>
>> That makes sense.
> 
> Attached is the v2 patch.

Thanks for the patch!

With the patch, I got the following error when executing make_etags..

$ ./src/tools/make_etags
etags: invalid option -- 'e'
	Try 'etags --help' for a complete list of options.
sort: No such file or directory


+		if [ $? != 0 -a -z "$ETAGS_EXISTS" ]
+		then	echo "'ctags' does not support emacs mode and etags does not exist" 1>&2; exit 1
+		fi

This code can be reached after "rm -f ./$TAGS_FILE" is executed in make_ctags.
But we should check whether the required program has been already installed
and exit immediately if not, before modifying anything?


This is the comment for the commit d1e2a380cb. I found that make_etags with
an invalid option reported the following usage message mentioning make_ctags
(not make_etags). Isn't this confusing?

$ ./src/tools/make_etags -a
Usage: /.../make_ctags [-e][-n]


Regards,

-- 
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION



Commits

  1. Fix make_etags breakage on certain platforms.

  2. Fix make_etags failure on Mac.

  3. Enhance make_ctags and make_etags.