From be600e5ac79fb5f6c8839d6a48d89fc2b917f0c7 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 14 Jun 2018 09:36:35 -0300 Subject: scripts/documentation-file-ref-check: add a fix logic for DT There are several links broken due to DT file movements. Add a hint logic to seek for those changes. Signed-off-by: Mauro Carvalho Chehab Acked-by: Jonathan Corbet --- scripts/documentation-file-ref-check | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/documentation-file-ref-check b/scripts/documentation-file-ref-check index 9d5e21b..c8bc1c1 100755 --- a/scripts/documentation-file-ref-check +++ b/scripts/documentation-file-ref-check @@ -64,7 +64,7 @@ while () { next if (grep -e, glob("$ref $fulref")); if ($fix) { - if (!($ref =~ m/(devicetree|scripts|Kconfig|Kbuild)/)) { + if (!($ref =~ m/(scripts|Kconfig|Kbuild)/)) { $broken_ref{$ref}++; } } else { @@ -84,10 +84,19 @@ foreach my $ref (keys %broken_ref) { # get just the basename $new =~ s,.*/,,; - # Seek for the same name on another place, as it may have been moved my $f=""; - $f = qx(find . -iname $new) if ($new); + # 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); + if (!$f) { + # Manufacturer name may have changed + $search =~ s/^.*,//; + $f = qx(find Documentation/devicetree/ -iname "*$search*") if ($search); + } + } # usual reason for breakage: file renamed to .rst if (!$f) { @@ -95,6 +104,11 @@ foreach my $ref (keys %broken_ref) { $f=qx(find . -iname $new) if ($new); } + # Wild guess: seek for the same name on another place + if (!$f) { + $f = qx(find . -iname $new) if ($new); + } + my @find = split /\s+/, $f; if (!$f) { -- cgit v1.1