summaryrefslogtreecommitdiffstats
path: root/scripts/documentation-file-ref-check
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2018-01-08 15:54:50 +0000
committerMark Brown <broonie@kernel.org>2018-01-08 15:54:50 +0000
commit498495dba268b20e8eadd7fe93c140c68b6cc9d2 (patch)
tree00d1562049d8bc2194fddd9ba0cbbe0812ad6f68 /scripts/documentation-file-ref-check
parentd5cc0a1fcbb5ddbef9fdd4c4a978da3254ddbf37 (diff)
parent5c256045b87b8aa8e5bc9d2e2fdc0802351c1f99 (diff)
downloadlinux-498495dba268b20e8eadd7fe93c140c68b6cc9d2.tar.gz
linux-498495dba268b20e8eadd7fe93c140c68b6cc9d2.tar.bz2
linux-498495dba268b20e8eadd7fe93c140c68b6cc9d2.zip
Merge branch 'fix/intel' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-intel
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