Re: make_ctags: use -I option to ignore pg_node_attr macro - Mailing list pgsql-hackers

From Tatsuo Ishii
Subject Re: make_ctags: use -I option to ignore pg_node_attr macro
Date
Msg-id 20230210.090701.934133164717491164.t-ishii@sranhm.sra.co.jp
Whole thread Raw
In response to Re: make_ctags: use -I option to ignore pg_node_attr macro  (Fujii Masao <masao.fujii@oss.nttdata.com>)
Responses Re: make_ctags: use -I option to ignore pg_node_attr macro  (Tatsuo Ishii <ishii@sraoss.co.jp>)
List pgsql-hackers
>> Oops. Thank you for pointing it out. BTW, just out of curiosity, do
>> you have etags on you Mac?
> 
> Yes.
> 
> $ etags --version
> etags (GNU Emacs 28.2)
> Copyright (C) 2022 Free Software Foundation, Inc.
> This program is distributed under the terms in ETAGS.README

Ok. Probably that was installed with emacs. For some reason I don't
know, I don't have etags even I already installed emacs. So I decided
to test using my old Ubuntu 18 vm, which has old ctags and etags.

> How about just applying the following into make_etags?
> 
> +if [ $# -gt 1 ] || ( [ $# -eq 1 ] && [ $1 != "-n" ] )
> +then    echo "Usage: $0 [-n]"
> +    exit 1
> +fi

Ok from me. Looks simple enough.

> With the patch, make_etags caused the following error messages
> on my MacOS.
> 
> $ ./src/tools/make_etags
> No such file or directory
> No such file or directory
> 
> To fix this error, probaby we should get rid of double-quotes
> from "$FLAGS" "$IGNORE_IDENTIFIES" in the following command.
> 
> -    xargs ctags $MODE -a -f $TAGS_FILE "$FLAGS" "$IGNORE_IDENTIFIES"
> + xargs $PROG $MODE $TAGS_OPT $TAGS_FILE "$FLAGS" "$IGNORE_IDENTIFIES"

Oh, I see.

> +    else    ctags --help 2>&1 | grep -- -e >/dev/null
> + # Note that "ctags --help" does not always work. Even certain ctags
> does not have the option.
> 
> This code seems to assume that there is non-Exuberant ctags
> supporting -e option. But does such ctags really exist?

Good question. I vaguely recalled so、but I haven't been able to find
any evidence for it.
> 
> I fixed the above issues and refactored the code.
> Attached is the updated version of the patch. Thought?

Thank you! Looks good to me.

Best reagards,
--
Tatsuo Ishii
SRA OSS LLC
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp



pgsql-hackers by date:

Previous
From: Andreas Karlsson
Date:
Subject: Re: ICU locale validation / canonicalization
Next
From: Andres Freund
Date:
Subject: Re: Importing pg_bsd_indent into our source tree