From: Jialu Xu Date: Fri, 7 Aug 2020 06:17:29 +0000 (-0700) Subject: scripts/tags.sh: collect compiled source precisely X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=4f491bb6ea2aef2f5b184f385904a73796d98554;p=linux.git scripts/tags.sh: collect compiled source precisely Parse compiled source from *.cmd but don't 'find' too many files that are not related to compilation. [xujialu@vimux.org: don't expand symlinks by add option -s for realpath] Link: http://lkml.kernel.org/r/5efc5bfb.1c69fb81.41bf5.7131SMTPIN_ADDED_MISSING@mx.google.com Signed-off-by: Jialu Xu Signed-off-by: Andrew Morton Cc: Greg Kroah-Hartman Cc: Masahiro Yamada Cc: Mauro Carvalho Chehab Cc: Jonathan Corbet Cc: Joe Perches Link: http://lkml.kernel.org/r/5ee5d8e3.1c69fb81.9b804.47b2SMTPIN_ADDED_MISSING@mx.google.com Signed-off-by: Linus Torvalds --- diff --git a/scripts/tags.sh b/scripts/tags.sh index 4e18ae5282a69..32d3f53af10ba 100755 --- a/scripts/tags.sh +++ b/scripts/tags.sh @@ -91,20 +91,10 @@ all_sources() all_compiled_sources() { - for i in $(all_sources); do - case "$i" in - *.[cS]) - j=${i/\.[cS]/\.o} - j="${j#$tree}" - if [ -e $j ]; then - echo $i - fi - ;; - *) - echo $i - ;; - esac - done + realpath -es $([ -z "$KBUILD_ABS_SRCTREE" ] && echo --relative-to=.) \ + include/generated/autoconf.h $(find -name "*.cmd" -exec \ + grep -Poh '(?(?=^source_.* \K).*|(?=^ \K\S).*(?= \\))' {} \+ | + awk '!a[$0]++') | sort -u } all_target_sources()