mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/4] scripts/tags.sh: use more portable -path instead of -wholename
@ 2023-12-29  3:06 Wei Yang
  2023-12-29  3:06 ` [PATCH 2/4] scripts/tags.sh: add local annotation Wei Yang
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Wei Yang @ 2023-12-29  3:06 UTC (permalink / raw)
  To: gregkh, masahiroy, nicolas
  Cc: linux-kernel, Wei Yang, Guennadi Liakhovetski, WANG Cong, Michal Marek

According to the manual, -path is more portable than -wholename. Also
for consistency, let's use -path here.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
CC: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
CC: WANG Cong <xiyou.wangcong@gmail.com>
CC: Michal Marek <mmarek@suse.cz>

merg
---
 scripts/tags.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/tags.sh b/scripts/tags.sh
index a70d43723146..fbae1a087ee1 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -50,7 +50,7 @@ fi
 find_arch_sources()
 {
 	for i in $archincludedir; do
-		prune="$prune -wholename $i -prune -o"
+		prune="$prune ( -path $i ) -prune -o"
 	done
 	find ${tree}arch/$1 $ignore $prune -name "$2" -not -type l -print;
 }
-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/4] scripts/tags.sh: add local annotation
  2023-12-29  3:06 [PATCH 1/4] scripts/tags.sh: use more portable -path instead of -wholename Wei Yang
@ 2023-12-29  3:06 ` Wei Yang
  2023-12-29  3:06 ` [PATCH 3/4] scripts/tags.sh: use -n to test archinclude Wei Yang
  2023-12-29  3:06 ` [PATCH 4/4] scripts/tags.sh: remove find_sources Wei Yang
  2 siblings, 0 replies; 4+ messages in thread
From: Wei Yang @ 2023-12-29  3:06 UTC (permalink / raw)
  To: gregkh, masahiroy, nicolas; +Cc: linux-kernel, Wei Yang

Commit 'f81b1be40c44 tags: include headers before source files'
introduce two local variables.

Let's add local annotation to make it obvious.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
---
 scripts/tags.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/tags.sh b/scripts/tags.sh
index fbae1a087ee1..83e3731b5bdf 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -50,7 +50,7 @@ fi
 find_arch_sources()
 {
 	for i in $archincludedir; do
-		prune="$prune ( -path $i ) -prune -o"
+		local prune="$prune ( -path $i ) -prune -o"
 	done
 	find ${tree}arch/$1 $ignore $prune -name "$2" -not -type l -print;
 }
@@ -58,7 +58,7 @@ find_arch_sources()
 # find sources in arch/$1/include
 find_arch_include_sources()
 {
-	include=$(find ${tree}arch/$1/ -name include -type d -print);
+	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;
-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 3/4] scripts/tags.sh: use -n to test archinclude
  2023-12-29  3:06 [PATCH 1/4] scripts/tags.sh: use more portable -path instead of -wholename Wei Yang
  2023-12-29  3:06 ` [PATCH 2/4] scripts/tags.sh: add local annotation Wei Yang
@ 2023-12-29  3:06 ` Wei Yang
  2023-12-29  3:06 ` [PATCH 4/4] scripts/tags.sh: remove find_sources Wei Yang
  2 siblings, 0 replies; 4+ messages in thread
From: Wei Yang @ 2023-12-29  3:06 UTC (permalink / raw)
  To: gregkh, masahiroy, nicolas; +Cc: linux-kernel, Wei Yang, Sam Ravnborg

In bash, "! -z" is equivalent to "-n", which seems to be more intuitive.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
CC: Sam Ravnborg <sam@ravnborg.org>
---
 scripts/tags.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/tags.sh b/scripts/tags.sh
index 83e3731b5bdf..5061ec255291 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -89,7 +89,7 @@ find_sources()
 all_sources()
 {
 	find_arch_include_sources ${SRCARCH} '*.[chS]'
-	if [ ! -z "$archinclude" ]; then
+	if [ -n "$archinclude" ]; then
 		find_arch_include_sources $archinclude '*.[chS]'
 	fi
 	find_include_sources '*.[chS]'
-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 4/4] scripts/tags.sh: remove find_sources
  2023-12-29  3:06 [PATCH 1/4] scripts/tags.sh: use more portable -path instead of -wholename Wei Yang
  2023-12-29  3:06 ` [PATCH 2/4] scripts/tags.sh: add local annotation Wei Yang
  2023-12-29  3:06 ` [PATCH 3/4] scripts/tags.sh: use -n to test archinclude Wei Yang
@ 2023-12-29  3:06 ` Wei Yang
  2 siblings, 0 replies; 4+ messages in thread
From: Wei Yang @ 2023-12-29  3:06 UTC (permalink / raw)
  To: gregkh, masahiroy, nicolas; +Cc: linux-kernel, Wei Yang, Jike Song

After commit '4f628248a578 kbuild: reintroduce ALLSOURCE_ARCHS support for
tags/cscope', find_sources only invoke find_arch_sources.

Signed-off-by: Wei Yang <richard.weiyang@gmail.com>
CC: Jike Song <albcamus@gmail.com>
---
 scripts/tags.sh | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/scripts/tags.sh b/scripts/tags.sh
index 5061ec255291..45568fee0cbb 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -81,11 +81,6 @@ find_other_sources()
 	       -name "$1" -not -type l -print;
 }
 
-find_sources()
-{
-	find_arch_sources $1 "$2"
-}
-
 all_sources()
 {
 	find_arch_include_sources ${SRCARCH} '*.[chS]'
@@ -95,7 +90,7 @@ all_sources()
 	find_include_sources '*.[chS]'
 	for arch in $ALLSOURCE_ARCHS
 	do
-		find_sources $arch '*.[chS]'
+		find_arch_sources $arch '*.[chS]'
 	done
 	find_other_sources '*.[chS]'
 }
@@ -125,7 +120,7 @@ all_kconfigs()
 	find ${tree}arch/ -maxdepth 1 $ignore \
 	       -name "Kconfig*" -not -type l -print;
 	for arch in $ALLSOURCE_ARCHS; do
-		find_sources $arch 'Kconfig*'
+		find_arch_sources $arch 'Kconfig*'
 	done
 	find_other_sources 'Kconfig*'
 }
-- 
2.34.1


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-12-29  3:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-29  3:06 [PATCH 1/4] scripts/tags.sh: use more portable -path instead of -wholename Wei Yang
2023-12-29  3:06 ` [PATCH 2/4] scripts/tags.sh: add local annotation Wei Yang
2023-12-29  3:06 ` [PATCH 3/4] scripts/tags.sh: use -n to test archinclude Wei Yang
2023-12-29  3:06 ` [PATCH 4/4] scripts/tags.sh: remove find_sources Wei Yang

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

all inboxes | Powered by JetHome®