Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
[linux-2.6-microblaze.git] / scripts / documentation-file-ref-check
index df8b221..9a8cc10 100755 (executable)
@@ -51,7 +51,9 @@ open IN, "git grep ':doc:\`' Documentation/|"
      or die "Failed to run git grep";
 while (<IN>) {
        next if (!m,^([^:]+):.*\:doc\:\`([^\`]+)\`,);
+       next if (m,sphinx/,);
 
+       my $file = $1;
        my $d = $1;
        my $doc_ref = $2;
 
@@ -60,7 +62,12 @@ while (<IN>) {
        $d =~ s,(.*/).*,$1,;
        $f =~ s,.*\<([^\>]+)\>,$1,;
 
-       $f ="$d$f.rst";
+       if ($f =~ m,^/,) {
+               $f = "$f.rst";
+               $f =~ s,^/,Documentation/,;
+       } else {
+               $f = "$d$f.rst";
+       }
 
        next if (grep -e, glob("$f"));
 
@@ -69,7 +76,7 @@ while (<IN>) {
        }
        $doc_fix++;
 
-       print STDERR "$f: :doc:`$doc_ref`\n";
+       print STDERR "$file: :doc:`$doc_ref`\n";
 }
 close IN;