mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
scripts/documentation-file-ref-check: better handle translations
Only seek for translation renames inside the translation directory. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
This commit is contained in:
committed by
Jonathan Corbet
parent
9b88ad5464
commit
9e78e7fc0b
@@ -141,6 +141,10 @@ print "Auto-fixing broken references. Please double-check the results\n";
|
|||||||
foreach my $ref (keys %broken_ref) {
|
foreach my $ref (keys %broken_ref) {
|
||||||
my $new =$ref;
|
my $new =$ref;
|
||||||
|
|
||||||
|
my $basedir = ".";
|
||||||
|
# On translations, only seek inside the translations directory
|
||||||
|
$basedir = $1 if ($ref =~ m,(Documentation/translations/[^/]+),);
|
||||||
|
|
||||||
# get just the basename
|
# get just the basename
|
||||||
$new =~ s,.*/,,;
|
$new =~ s,.*/,,;
|
||||||
|
|
||||||
@@ -161,18 +165,18 @@ foreach my $ref (keys %broken_ref) {
|
|||||||
# usual reason for breakage: file renamed to .rst
|
# usual reason for breakage: file renamed to .rst
|
||||||
if (!$f) {
|
if (!$f) {
|
||||||
$new =~ s/\.txt$/.rst/;
|
$new =~ s/\.txt$/.rst/;
|
||||||
$f=qx(find . -iname $new) if ($new);
|
$f=qx(find $basedir -iname $new) if ($new);
|
||||||
}
|
}
|
||||||
|
|
||||||
# usual reason for breakage: use dash or underline
|
# usual reason for breakage: use dash or underline
|
||||||
if (!$f) {
|
if (!$f) {
|
||||||
$new =~ s/[-_]/[-_]/g;
|
$new =~ s/[-_]/[-_]/g;
|
||||||
$f=qx(find . -iname $new) if ($new);
|
$f=qx(find $basedir -iname $new) if ($new);
|
||||||
}
|
}
|
||||||
|
|
||||||
# Wild guess: seek for the same name on another place
|
# Wild guess: seek for the same name on another place
|
||||||
if (!$f) {
|
if (!$f) {
|
||||||
$f = qx(find . -iname $new) if ($new);
|
$f = qx(find $basedir -iname $new) if ($new);
|
||||||
}
|
}
|
||||||
|
|
||||||
my @find = split /\s+/, $f;
|
my @find = split /\s+/, $f;
|
||||||
|
Reference in New Issue
Block a user