summaryrefslogtreecommitdiff
path: root/scripts/documentation-file-ref-check
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2017-11-14 12:01:49 +0300
committerThomas Gleixner <tglx@linutronix.de>2017-11-14 12:01:49 +0300
commitd4bfeabe9ff7967f4b8c24aabf2de1ce3a909cd9 (patch)
tree6b419b8497c7d57ddec20a3558697ef36ea37b11 /scripts/documentation-file-ref-check
parent8a7a8e1eab929eb3a5b735a788a23b9731139046 (diff)
parentb29c6ef7bb1257853c1e31616d84f55e561cf631 (diff)
downloadlinux-d4bfeabe9ff7967f4b8c24aabf2de1ce3a909cd9.tar.xz
Merge branch 'linus' into timers/urgent
Get upstream changes so dependent patches can be applied.
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