Rust for Linux List
 help / color / mirror / Atom feed
* [PATCH] scripts/tags.sh: fix "make COMPILED_SOURCE=1 cscope" command ends up with *.rlib, *.rmeta, *.so filenames in cscope.files
@ 2026-05-30  7:06 Sergei Litvin
  0 siblings, 0 replies; only message in thread
From: Sergei Litvin @ 2026-05-30  7:06 UTC (permalink / raw)
  To: rust-for-linux; +Cc: linux-kernel, ojeda, Sergei Litvin

When executing the command `make COMPILED_SOURCE=1 cscope`, the `cscope.files`
file generated by it includes filenames with the extensions *.rlib, *.rmeta,
and *.so (taken from *.cmd files, which, in turn, are generated from *.d
dependency files by the `fixdep` utility).

Signed-off-by: Sergei Litvin <litvindev@gmail.com>
---
 scripts/tags.sh | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/scripts/tags.sh b/scripts/tags.sh
index 243373683f98..f6642bb0f8ee 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -52,7 +52,7 @@ find_arch_sources()
 	for i in $archincludedir; do
 		local prune="$prune ( -path $i ) -prune -o"
 	done
-	find ${tree}arch/$1 $ignore $prune -name "$2" -not -type l -print;
+	find ${tree}arch/$1 $ignore $prune -regextype posix-extended -regex "$2" -not -type l -print;
 }
 
 # find sources in arch/$1/include
@@ -61,14 +61,14 @@ find_arch_include_sources()
 	local include=$(find ${tree}arch/$1/ -name include -type d -print);
 	if [ -n "$include" ]; then
 		archincludedir="$archincludedir $include"
-		find $include $ignore -name "$2" -not -type l -print;
+		find $include $ignore -regextype posix-extended -regex "$2" -not -type l -print;
 	fi
 }
 
 # find sources in include/
 find_include_sources()
 {
-	find ${tree}include $ignore -name config -prune -o -name "$1" \
+	find ${tree}include $ignore -name config -prune -o -regextype posix-extended -regex "$1" \
 		-not -type l -print;
 }
 
@@ -78,21 +78,21 @@ find_other_sources()
 {
 	find ${tree}* $ignore \
 	     \( -path ${tree}include -o -path ${tree}arch -o -name '.tmp_*' \) -prune -o \
-	       -name "$1" -not -type l -print;
+	       -regextype posix-extended -regex "$1" -not -type l -print;
 }
 
 all_sources()
 {
-	find_arch_include_sources ${SRCARCH} '*.[chS]'
+	find_arch_include_sources ${SRCARCH} '.*\.([chS]|rs)'
 	if [ -n "$archinclude" ]; then
-		find_arch_include_sources $archinclude '*.[chS]'
+		find_arch_include_sources $archinclude '.*\.([chS]|rs)'
 	fi
-	find_include_sources '*.[chS]'
+	find_include_sources '.*\.([chS]|rs)'
 	for arch in $ALLSOURCE_ARCHS
 	do
-		find_arch_sources $arch '*.[chS]'
+		find_arch_sources $arch '.*\.([chS]|rs)'
 	done
-	find_other_sources '*.[chS]'
+	find_other_sources '.*\.([chS]|rs)'
 }
 
 all_compiled_sources()
@@ -100,7 +100,7 @@ all_compiled_sources()
 	{
 		echo include/generated/autoconf.h
 		find $ignore -name "*.cmd" -exec \
-			grep -Poh '(?<=^  )\S+|(?<== )\S+[^\\](?=$)' {} \+ |
+			grep -Poh '(?<=^  )\S+\.([chS]|rs)|(?<== )\S+\.(?1)(?=$)' {} \+ |
 		awk '!a[$0]++'
 	} | xargs realpath -esq $([ -z "$KBUILD_ABS_SRCTREE" ] && echo --relative-to=.) |
 	sort -u
-- 
2.54.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-05-30  7:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-30  7:06 [PATCH] scripts/tags.sh: fix "make COMPILED_SOURCE=1 cscope" command ends up with *.rlib, *.rmeta, *.so filenames in cscope.files Sergei Litvin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox