Skip to content

Commit a4ea67b

Browse files
mchehabgregkh
authored andcommitted
scripts: get_abi.pl: prevent duplicated file names
The same filename may exist on multiple directories within ABI. Create separate entries at the internal database for each of them. Acked-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Link: https://lore.kernel.org/r/ef760f68f54e132c4be52f0027189b4ba31554ec.1604042072.git.mchehab+huawei@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent a16ab14 commit a4ea67b

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

scripts/get_abi.pl

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,10 @@ sub parse_abi {
6565
my $name = $file;
6666
$name =~ s,.*/,,;
6767

68-
my $nametag = "File $name";
68+
my $fn = $file;
69+
$fn =~ s,Documentation/ABI/,,;
70+
71+
my $nametag = "File $fn";
6972
$data{$nametag}->{what} = "File $name";
7073
$data{$nametag}->{type} = "File";
7174
$data{$nametag}->{file} = $name;
@@ -320,16 +323,18 @@ sub output_rest {
320323
my $fileref = "abi_file_".$path;
321324

322325
if ($type eq "File") {
323-
my $bar = $w;
324-
$bar =~ s/./-/g;
325-
326326
print ".. _$fileref:\n\n";
327-
print "$w\n$bar\n\n";
328327
} else {
329328
print "Defined on file :ref:`$f <$fileref>`\n\n";
330329
}
331330
}
332331

332+
if ($type eq "File") {
333+
my $bar = $w;
334+
$bar =~ s/./-/g;
335+
print "$w\n$bar\n\n";
336+
}
337+
333338
my $desc = "";
334339
$desc = $data{$what}->{description} if (defined($data{$what}->{description}));
335340
$desc =~ s/\s+$/\n/;

0 commit comments

Comments
 (0)