aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Droneaud <ydroneaud@opteya.com>2014-05-21 09:32:17 -0400
committerMichal Marek <mmarek@suse.cz>2014-06-09 16:59:24 -0400
commit9b24a15d81f4b7cd50c3cf13c0e753c865e345df (patch)
tree051737f682f83475ba1f5e4a42a06104d519feec
parent79c704a87834164259b7aa7469d426d6ba351eec (diff)
scripts/tags.sh: ignore symlink'ed source files
Since commit 22d651dcef536c75f75537290bf3da5038e68b6b ('selftests/powerpc: Import Anton's memcpy / copy_tofrom_user tests'), some source files in the tree appear as symlink. Until commit 8c38a5328af8080bc69a25b3e4e144b03eeea95e ('scripts/tags.sh: ignore code of user space tools'), those symlinks made cscope report some warnings: $ make ALLSOURCE_ARCHS=all O=./obj-cscope/ cscope GEN cscope cscope: cannot find file .../tools/testing/selftests/powerpc/copyloops/copyuser_power7.S cscope: cannot find file .../tools/testing/selftests/powerpc/copyloops/memcpy_64.S cscope: cannot find file .../tools/testing/selftests/powerpc/copyloops/memcpy_power7.S cscope: cannot find file .../tools/testing/selftests/powerpc/copyloops/copyuser_64.S In order to prevent the same kind of warnings to be triggered by future addition of symlinks, the best option is to ignore all symlinks when building the file list to be processed by cscope (and other tools supported by scripts/tags.sh). Ignoring symlinks won't hide source files from cscope (and others) as the target of these symlinks already appear somewhere else in the tree, and, as such, should be processed by cscope (or others). Note that, cscope, when used with -R option to make it find the files to process by itself, already skip symlinks: it's not expected that cscope access source files through symlink. On top of commit 8c38a5328af8080bc69a25b3e4e144b03eeea95e ('scripts/tags.sh: ignore code of user space tools'), scripts/tags.sh output from "make cscope tags TAGS" is the same with and without this patch: it doesn't seems to introduce any regression (on Fedora 20). Link: http://lkml.kernel.org/r/1396530975.4361.28.camel@localhost.localdomain Link: http://mid.gmane.org/534312F8.5090609@t-online.de Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Anton Blanchard <anton@samba.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Hans-Bernhard Bröker <broeker@users.sourceforge.net>, Cc: Hans-Bernhard Broeker <broeker@physik.rwth-aachen.de>, Cc: Neil Horman <nhorman@users.sourceforge.net> Cc: Neil Horman <nhorman@tuxdriver.com> Cc: Gerhard Sittig <gsi@denx.de> Cc: Konstantin Khlebnikov <koct9i@gmail.com> Signed-off-by: Yann Droneaud <ydroneaud@opteya.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
-rwxr-xr-xscripts/tags.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/tags.sh b/scripts/tags.sh
index 1c50de820289..4c425d25173c 100755
--- a/scripts/tags.sh
+++ b/scripts/tags.sh
@@ -50,7 +50,8 @@ find_arch_sources()
50 for i in $archincludedir; do 50 for i in $archincludedir; do
51 prune="$prune -wholename $i -prune -o" 51 prune="$prune -wholename $i -prune -o"
52 done 52 done
53 find ${tree}arch/$1 $ignore $subarchprune $prune -name "$2" -print; 53 find ${tree}arch/$1 $ignore $subarchprune $prune -name "$2" \
54 -not -type l -print;
54} 55}
55 56
56# find sources in arch/$1/include 57# find sources in arch/$1/include
@@ -60,14 +61,15 @@ find_arch_include_sources()
60 -name include -type d -print); 61 -name include -type d -print);
61 if [ -n "$include" ]; then 62 if [ -n "$include" ]; then
62 archincludedir="$archincludedir $include" 63 archincludedir="$archincludedir $include"
63 find $include $ignore -name "$2" -print; 64 find $include $ignore -name "$2" -not -type l -print;
64 fi 65 fi
65} 66}
66 67
67# find sources in include/ 68# find sources in include/
68find_include_sources() 69find_include_sources()
69{ 70{
70 find ${tree}include $ignore -name config -prune -o -name "$1" -print; 71 find ${tree}include $ignore -name config -prune -o -name "$1" \
72 -not -type l -print;
71} 73}
72 74
73# find sources in rest of tree 75# find sources in rest of tree
@@ -76,7 +78,7 @@ find_other_sources()
76{ 78{
77 find ${tree}* $ignore \ 79 find ${tree}* $ignore \
78 \( -name include -o -name arch -o -name '.tmp_*' \) -prune -o \ 80 \( -name include -o -name arch -o -name '.tmp_*' \) -prune -o \
79 -name "$1" -print; 81 -name "$1" -not -type l -print;
80} 82}
81 83
82find_sources() 84find_sources()