scripts/documentation-file-ref-check: check tools/*/Documentation
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Thu, 14 Jun 2018 14:06:08 +0000 (11:06 -0300)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Fri, 15 Jun 2018 21:10:01 +0000 (18:10 -0300)
Some files, like tools/memory-model/README has references to
a Documentation file that is locale to it. Handle references
that are relative to them too.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Acked-by: Jonathan Corbet <corbet@lwn.net>
scripts/documentation-file-ref-check

index 047f463cdf4be8833d88e80081bdc8badbac05d1..078999a3fdff7542ff52db288b96d9f0848e1c49 100755 (executable)
@@ -78,6 +78,13 @@ while (<IN>) {
                # Check if exists, evaluating wildcards
                next if (grep -e, glob("$ref $fulref"));
 
+               # Accept relative Documentation patches for tools/
+               if ($f =~ m/tools/) {
+                       my $path = $f;
+                       $path =~ s,(.*)/.*,$1,;
+                       next if (grep -e, glob("$path/$ref $path/$fulref"));
+               }
+
                if ($fix) {
                        if (!($ref =~ m/(scripts|Kconfig|Kbuild)/)) {
                                $broken_ref{$ref}++;