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.
Showing the changes to scripts/documentation-file-ref-check (1 of 4 files). Show all
Unified · Split
| @@ -22,9 +22,16 @@ $scriptname =~ s,.*/([^/]+/),$1,; · 21 unmodified lines | ||
| 22 | 22 | # Parse arguments |
| 23 | 23 | my $help = 0; |
| 24 | 24 | 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 | +} | |
| 25 | 31 | |
| 26 | 32 | GetOptions( |
| 27 | 33 | 'fix' => \$fix, |
| 34 | + 'warn' => \$warn, | |
| 28 | 35 | 'h|help|usage' => \$help, |
| 29 | 36 | ); |
| 30 | 37 | |
| @@ -139,6 +146,8 @@ while (<IN>) { · 108 unmodified lines | ||
| 139 | 146 | if (!($ref =~ m/(scripts|Kconfig|Kbuild)/)) { |
| 140 | 147 | $broken_ref{$ref}++; |
| 141 | 148 | } |
| 149 | + } elsif ($warn) { | |
| 150 | + print STDERR "Warning: $f references a file that doesn't exist: $fulref\n"; | |
| 142 | 151 | } else { |
| 143 | 152 | print STDERR "$f: $fulref\n"; |
| 144 | 153 | } |