summaryrefslogtreecommitdiff
path: root/scripts/documentation-file-ref-check
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2017-11-28 19:19:52 +0300
committerMark Brown <broonie@kernel.org>2017-11-28 19:19:52 +0300
commit69830d3909849dee33b9a2de88ece3d59c75a1b8 (patch)
tree67e22ac989e782ddc104f186dee54d1675e76923 /scripts/documentation-file-ref-check
parentaf1b1cefd735c919d3185ce06b549c2b121067ba (diff)
parentef2e8175eb19011f756469d4d14f4207bf7f289c (diff)
downloadlinux-69830d3909849dee33b9a2de88ece3d59c75a1b8.tar.xz
Merge branch 'topic/disconnect' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-rcar
Diffstat (limited to 'scripts/documentation-file-ref-check')
-rwxr-xr-xscripts/documentation-file-ref-check15
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/documentation-file-ref-check b/scripts/documentation-file-ref-check
new file mode 100755
index 000000000000..bc1659900e89
--- /dev/null
+++ b/scripts/documentation-file-ref-check
@@ -0,0 +1,15 @@
+#!/bin/sh
+# Treewide grep for references to files under Documentation, and report
+# non-existing files in stderr.
+
+for f in $(git ls-files); do
+ for ref in $(grep -ho "Documentation/[A-Za-z0-9_.,~/*+-]*" "$f"); do
+ # presume trailing . and , are not part of the name
+ ref=${ref%%[.,]}
+
+ # use ls to handle wildcards
+ if ! ls $ref >/dev/null 2>&1; then
+ echo "$f: $ref" >&2
+ fi
+ done
+done