X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=scripts%2Fdocumentation-file-ref-check;fp=scripts%2Fdocumentation-file-ref-check;h=bc1659900e891806d1066a098b484ba481b54932;hb=e8939222dced668fc5cae02b0b601af069801107;hp=0000000000000000000000000000000000000000;hpb=8d73c512e648bee83b912733876b9b4071353265;p=mirror_ubuntu-bionic-kernel.git 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