Re: [PATCH v4 2/2] scripts: Add a intermediate file for 'make gtags'

From: Masahiro Yamada
Date: Mon May 11 2020 - 23:09:49 EST


On Sat, May 2, 2020 at 2:34 PM xujialu <xujialu@xxxxxxxxx> wrote:
>
> As 'GTAGS Manual' said: If Âgtags.files exists in the current directory
> directory or a file is specified by the -f option, target files are
> limited by it.
>
> So add gtags.files just like cscope.files.
>
> Signed-off-by: xujialu <xujialu@xxxxxxxxx>
> ---
> Makefile | 2 +-
> scripts/tags.sh | 3 ++-
> 2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 679f302a8b8b..2c8304ae103f 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1398,7 +1398,7 @@ MRPROPER_FILES += .config .config.old .version \
>
> # Directories & files removed with 'make distclean'
> DISTCLEAN_DIRS +=
> -DISTCLEAN_FILES += tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS
> +DISTCLEAN_FILES += tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS gtags.files
>
> # clean - Delete most, but leave enough to build external modules
> #
> diff --git a/scripts/tags.sh b/scripts/tags.sh
> index 941a5c61d343..e2edd0cf67ec 100755
> --- a/scripts/tags.sh
> +++ b/scripts/tags.sh
> @@ -142,7 +142,8 @@ docscope()
>
> dogtags()
> {
> - all_target_sources | gtags -i -f -
> + all_target_sources > gtags.files
> + gtags -i -f gtags.files
> }

My previous reply was not sent to the list.

Here is the summary of my view.



With my basic knowledge of UNIX
such as the concept of pipe, redirect, etc.,
the following two commands should do the same work.


[1] { echo file lists; } | gtags -f -

[2] { echo file lists; } > tmpfile
gtags -f tmpfile





The gtags manual also says:
-f, --file file
Give a list of candidates of target files.
Files which are not on the list are ignored.
The argument file can be set to Â-Â to accept
a list of files from the standard input.



This patch looks no point to me.




As for the cscope.files, we had a reason to have it separately.


This commit:

https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/commit/?id=3cd681bae4360e2f67ef9b232db28e13319f1c17


And, the bug was elaborated here:

https://bugzilla.kernel.org/show_bug.cgi?id=1948







--
Best Regards
Masahiro Yamada