diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2010-02-07 18:25:59 -0500 |
---|---|---|
committer | Michal Marek <mmarek@suse.cz> | 2010-02-17 07:59:13 -0500 |
commit | f81b1be40c44b33b9706d64c117edd29e627ad12 (patch) | |
tree | 6977ad3196429112dc02fc44cd6d901dc032990d /scripts | |
parent | d0679c730395d0bde9a46939e7ba255b4ba7dd7c (diff) |
tags: include headers before source files
Currently looking up a structure definition in TAGS / tags takes one to
one of multiple "static struct X" definitions in arch sources, which makes
it for many structs practically impossible to get to the required header.
This patch changes the order of sources being tagged to first scan
architecture includes, then the top-level include/ directory, and only
then the rest. It also takes into account, that many architectures have
more than one include directory, i.e., not only arch/$ARCH/include, but
also arch/$ARCH/mach-X/include etc.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com>
[mmarek@suse.cz: fix 'var+=text' bashism]
Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/tags.sh | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/scripts/tags.sh b/scripts/tags.sh index 1a0c44d7c4a7..c1220419e59d 100755 --- a/scripts/tags.sh +++ b/scripts/tags.sh | |||
@@ -32,13 +32,20 @@ fi | |||
32 | # find sources in arch/$ARCH | 32 | # find sources in arch/$ARCH |
33 | find_arch_sources() | 33 | find_arch_sources() |
34 | { | 34 | { |
35 | find ${tree}arch/$1 $ignore -name "$2" -print; | 35 | for i in $archincludedir; do |
36 | prune="$prune -wholename $i -prune -o" | ||
37 | done | ||
38 | find ${tree}arch/$1 $ignore $prune -name "$2" -print; | ||
36 | } | 39 | } |
37 | 40 | ||
38 | # find sources in arch/$1/include | 41 | # find sources in arch/$1/include |
39 | find_arch_include_sources() | 42 | find_arch_include_sources() |
40 | { | 43 | { |
41 | find ${tree}arch/$1/include $ignore -name "$2" -print; | 44 | include=$(find ${tree}arch/$1/ -name include -type d); |
45 | if [ -n "$include" ]; then | ||
46 | archincludedir="$archincludedir $include" | ||
47 | find $include $ignore -name "$2" -print; | ||
48 | fi | ||
42 | } | 49 | } |
43 | 50 | ||
44 | # find sources in include/ | 51 | # find sources in include/ |
@@ -63,14 +70,15 @@ find_sources() | |||
63 | 70 | ||
64 | all_sources() | 71 | all_sources() |
65 | { | 72 | { |
66 | for arch in $ALLSOURCE_ARCHS | 73 | find_arch_include_sources ${ARCH} '*.[chS]' |
67 | do | ||
68 | find_sources $arch '*.[chS]' | ||
69 | done | ||
70 | if [ ! -z "$archinclude" ]; then | 74 | if [ ! -z "$archinclude" ]; then |
71 | find_arch_include_sources $archinclude '*.[chS]' | 75 | find_arch_include_sources $archinclude '*.[chS]' |
72 | fi | 76 | fi |
73 | find_include_sources '*.[chS]' | 77 | find_include_sources '*.[chS]' |
78 | for arch in $ALLSOURCE_ARCHS | ||
79 | do | ||
80 | find_sources $arch '*.[chS]' | ||
81 | done | ||
74 | find_other_sources '*.[chS]' | 82 | find_other_sources '*.[chS]' |
75 | } | 83 | } |
76 | 84 | ||