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
2222 # Parse arguments
2323 my $help = 0;
2424 my $fix = 0;
25+my $warn = 0;
26+
27+if (! -d ".git") {
28+ printf "Warning: can't check if file exists, as this is not a git tree";
29+ exit 0;
30+}
2531
2632 GetOptions(
2733 'fix' => \$fix,
34+ 'warn' => \$warn,
2835 'h|help|usage' => \$help,
2936 );
3037
@@ -139,6 +146,8 @@ while (<IN>) { · 108 unmodified lines
139146 if (!($ref =~ m/(scripts|Kconfig|Kbuild)/)) {
140147 $broken_ref{$ref}++;
141148 }
149+ } elsif ($warn) {
150+ print STDERR "Warning: $f references a file that doesn't exist: $fulref\n";
142151 } else {
143152 print STDERR "$f: $fulref\n";
144153 }