Skip to content

Commit

Permalink
scripts/documentation-file-ref-check: teach about .txt -> .yaml renames
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mchehab authored and Jonathan Corbet committed May 30, 2019
1 parent 4904aee commit 0ca862e
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions scripts/documentation-file-ref-check
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

Expand Down

0 comments on commit 0ca862e

Please sign in to comment.