summaryrefslogtreecommitdiff
path: root/scripts/documentation-file-ref-check
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2017-11-29 07:11:24 +0100
committerIngo Molnar <mingo@kernel.org>2017-11-29 07:11:24 +0100
commit4fc31ba13d052c2933bf91095c063cf9a39effd0 (patch)
treebeabb73c2fe245e6541126732895da62e55bc8ee /scripts/documentation-file-ref-check
parent0e18dd12064e07519f7cbff4149ca7fff620cbed (diff)
parentb29c6ef7bb1257853c1e31616d84f55e561cf631 (diff)
Merge branch 'linus' into perf/urgent, to pick up dependent commits
Signed-off-by: Ingo Molnar <mingo@kernel.org>
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