mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 06:01:23 +00:00
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 <mchehab+samsung@kernel.org> Acked-by: Jonathan Corbet <corbet@lwn.net>
This commit is contained in:
parent
5044024002
commit
be600e5ac7
1 changed files with 17 additions and 3 deletions
|
@ -64,7 +64,7 @@ while (<IN>) {
|
||||||
next if (grep -e, glob("$ref $fulref"));
|
next if (grep -e, glob("$ref $fulref"));
|
||||||
|
|
||||||
if ($fix) {
|
if ($fix) {
|
||||||
if (!($ref =~ m/(devicetree|scripts|Kconfig|Kbuild)/)) {
|
if (!($ref =~ m/(scripts|Kconfig|Kbuild)/)) {
|
||||||
$broken_ref{$ref}++;
|
$broken_ref{$ref}++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -84,10 +84,19 @@ foreach my $ref (keys %broken_ref) {
|
||||||
# get just the basename
|
# get just the basename
|
||||||
$new =~ s,.*/,,;
|
$new =~ s,.*/,,;
|
||||||
|
|
||||||
# Seek for the same name on another place, as it may have been moved
|
|
||||||
my $f="";
|
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
|
# usual reason for breakage: file renamed to .rst
|
||||||
if (!$f) {
|
if (!$f) {
|
||||||
|
@ -95,6 +104,11 @@ foreach my $ref (keys %broken_ref) {
|
||||||
$f=qx(find . -iname $new) if ($new);
|
$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;
|
my @find = split /\s+/, $f;
|
||||||
|
|
||||||
if (!$f) {
|
if (!$f) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue