History

docs: Kbuild/Makefile: allow check for missing docs at build time

While this doesn't make sense for production Kernels, in order to avoid regressions when documents are touched, let's add a check target at the make file.

Mauro Carvalho Chehab committed 7 years ago

Commit b1663d71 parent 3f9564e4 files · +29 −0Browse files

Showing the changes to scripts/documentation-file-ref-check (1 of 4 files). Show all

Unified · Split

scripts/documentation-file-ref-check+9−0
@@ -22,9 +22,16 @@ $scriptname =~ s,.*/([^/]+/),$1,; · 21 unmodified lines
22# Parse arguments22# Parse arguments
23my $help = 0;23my $help = 0;
24my $fix = 0;24my $fix = 0;
25my $warn = 0;
26
27if (! -d ".git") {
28 printf "Warning: can't check if file exists, as this is not a git tree";
29 exit 0;
30}
25 31
26GetOptions(32GetOptions(
27 'fix' => \$fix,33 'fix' => \$fix,
34 'warn' => \$warn,
28 'h|help|usage' => \$help,35 'h|help|usage' => \$help,
29);36);
30 37
@@ -139,6 +146,8 @@ while (<IN>) { · 108 unmodified lines
139 if (!($ref =~ m/(scripts|Kconfig|Kbuild)/)) {146 if (!($ref =~ m/(scripts|Kconfig|Kbuild)/)) {
140 $broken_ref{$ref}++;147 $broken_ref{$ref}++;
141 }148 }
149 } elsif ($warn) {
150 print STDERR "Warning: $f references a file that doesn't exist: $fulref\n";
142 } else {151 } else {
143 print STDERR "$f: $fulref\n";152 print STDERR "$f: $fulref\n";
144 }153 }