summaryrefslogtreecommitdiffstats
path: root/scripts/documentation-file-ref-check
diff options
context:
space:
mode:
authorMauro Carvalho Chehab2019-05-30 01:09:30 +0200
committerJonathan Corbet2019-05-30 18:40:24 +0200
commit0ca862e6f1c7e58e4eb9758fdb09255e6104d6a0 (patch)
treec369ef711e0c882d510a84504fa923a850fbba6f /scripts/documentation-file-ref-check
parentscripts/documentation-file-ref-check: improve tools ref handling (diff)
downloadkernel-qcow2-linux-0ca862e6f1c7e58e4eb9758fdb09255e6104d6a0.tar.gz
kernel-qcow2-linux-0ca862e6f1c7e58e4eb9758fdb09255e6104d6a0.tar.xz
kernel-qcow2-linux-0ca862e6f1c7e58e4eb9758fdb09255e6104d6a0.zip
scripts/documentation-file-ref-check: teach about .txt -> .yaml renames
At DT, files are being renamed to jason. Teach the script how to handle such renames when used in fix mode. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'scripts/documentation-file-ref-check')
-rwxr-xr-xscripts/documentation-file-ref-check19
1 files changed, 14 insertions, 5 deletions
diff --git a/scripts/documentation-file-ref-check b/scripts/documentation-file-ref-check
index 5d775ca7469b..ff16db269079 100755
--- a/scripts/documentation-file-ref-check
+++ b/scripts/documentation-file-ref-check
@@ -165,13 +165,22 @@ foreach my $ref (keys %broken_ref) {
# usual reason for breakage: DT file moved around
if ($ref =~ /devicetree/) {
- my $search = $new;
- $search =~ s,^.*/,,;
- $f = qx(find Documentation/devicetree/ -iname "*$search*") if ($search);
+ # usual reason for breakage: DT file renamed to .yaml
if (!$f) {
- # Manufacturer name may have changed
- $search =~ s/^.*,//;
+ my $new_ref = $ref;
+ $new_ref =~ s/\.txt$/.yaml/;
+ $f=$new_ref if (-f $new_ref);
+ }
+
+ if (!$f) {
+ my $search = $new;
+ $search =~ s,^.*/,,;
$f = qx(find Documentation/devicetree/ -iname "*$search*") if ($search);
+ if (!$f) {
+ # Manufacturer name may have changed
+ $search =~ s/^.*,//;
+ $f = qx(find Documentation/devicetree/ -iname "*$search*") if ($search);
+ }
}
}