Skip to content

Commit 2177379

Browse files
haokexinakpm00
authored andcommitted
scripts/tags.sh: fix the Kconfig tags generation when using latest ctags
The Kconfig language has already been built-in in the latest ctags, so it would error exit if we try to define it as an user-defined language via '--langdef=kconfig'. This results that there is no Kconfig tags in the final tag file. Fix this by skipping the user Kconfig definition for the latest ctags. Link: https://lkml.kernel.org/r/20230128064916.912744-1-haokexin@gmail.com Signed-off-by: Kevin Hao <haokexin@gmail.com> Reviewed-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Masahiro Yamada <masahiroy@kernel.org> Cc: Nicolas Schier <nicolas@fjasle.eu> Cc: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com> Cc: Vipin Sharma <vipinsh@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 602ce7b commit 2177379

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

scripts/tags.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,12 @@ exuberant()
264264
--$CTAGS_EXTRA=+fq --c-kinds=+px --fields=+iaS --langmap=c:+.h \
265265
"${regex[@]}"
266266

267-
setup_regex exuberant kconfig
268-
all_kconfigs | xargs $1 -a \
269-
--langdef=kconfig --language-force=kconfig "${regex[@]}"
270-
267+
KCONFIG_ARGS=()
268+
if ! $1 --list-languages | grep -iq kconfig; then
269+
setup_regex exuberant kconfig
270+
KCONFIG_ARGS=(--langdef=kconfig --language-force=kconfig "${regex[@]}")
271+
fi
272+
all_kconfigs | xargs $1 -a "${KCONFIG_ARGS[@]}"
271273
}
272274

273275
emacs()

0 commit comments

Comments
 (0)