scripts/tags.sh: use more portable -path instead of -wholename
PATCH 1/4 scripts/tags.sh: use more portable -path instead of -wholename
According to the manual, -path is more portable than -wholename. Also for consistency, let's use -path here.
Signed-off-by Wei Yang <[email protected]>
CC Guennadi Liakhovetski <[email protected]>
CC WANG Cong <[email protected]>
CC Michal Marek <[email protected]>
merg
--- scripts/tags.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/tags.sh +1 -1
@@ -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; }
Signature · 1 line
2.34.1
PATCH 2/4 scripts/tags.sh: add local annotation
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 <[email protected]>
--- scripts/tags.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/tags.sh +2 -2
@@ -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;
Signature · 1 line
2.34.1
PATCH 3/4 scripts/tags.sh: use -n to test archinclude
In reply to Wei YangIn bash, "! -z" is equivalent to "-n", which seems to be more intuitive.
Signed-off-by Wei Yang <[email protected]>
CC Sam Ravnborg <[email protected]>
--- scripts/tags.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/tags.sh +1 -1
@@ -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]'
Signature · 1 line
2.34.1
PATCH 4/4 scripts/tags.sh: remove find_sources
In reply to Wei YangAfter commit '4f628248a578 kbuild: reintroduce ALLSOURCE_ARCHS support for tags/cscope', find_sources only invoke find_arch_sources.
Signed-off-by Wei Yang <[email protected]>
CC Jike Song <[email protected]>
--- scripts/tags.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
scripts/tags.sh +2 -7
@@ -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*' }
Signature · 1 line
2.34.1