* Re: [PATCH v2 08/39] scripts: get_abi.pl: prevent duplicated file names
@ 2020-12-08 13:35 Nícolas F. R. A. Prado
0 siblings, 0 replies; 2+ messages in thread
From: Nícolas F. R. A. Prado @ 2020-12-08 13:35 UTC (permalink / raw)
To: Mauro Carvalho Chehab
Cc: Linux Doc Mailing List, Jonathan Corbet, Jonathan Cameron,
Oded Gabbay, Tom Rix, Vaibhav Jain, linux-kernel
On Fri, Oct 30, 2020 at 08:40:27AM +0100, Mauro Carvalho Chehab wrote:
> The same filename may exist on multiple directories within
> ABI. Create separate entries at the internal database for
> each of them.
>
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> ---
> scripts/get_abi.pl | 15 ++++++++++-----
> 1 file changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl
> index e5a5588a8639..5612f019fae0 100755
> --- a/scripts/get_abi.pl
> +++ b/scripts/get_abi.pl
> @@ -65,7 +65,10 @@ sub parse_abi {
> my $name = $file;
> $name =~ s,.*/,,;
>
> - my $nametag = "File $name";
> + my $fn = $file;
> + $fn =~ s,Documentation/ABI/,,;
> +
> + my $nametag = "File $fn";
> $data{$nametag}->{what} = "File $name";
> $data{$nametag}->{type} = "File";
> $data{$nametag}->{file} = $name;
> @@ -320,16 +323,18 @@ sub output_rest {
> my $fileref = "abi_file_".$path;
>
> if ($type eq "File") {
> - my $bar = $w;
> - $bar =~ s/./-/g;
> -
> print ".. _$fileref:\n\n";
> - print "$w\n$bar\n\n";
> } else {
> print "Defined on file :ref:`$f <$fileref>`\n\n";
> }
> }
>
> + if ($type eq "File") {
> + my $bar = $w;
> + $bar =~ s/./-/g;
> + print "$w\n$bar\n\n";
> + }
> +
> my $desc = "";
> $desc = $data{$what}->{description} if (defined($data{$what}->{description}));
> $desc =~ s/\s+$/\n/;
> --
> 2.26.2
>
Hey Mauro,
just a heads-up.
It seems the ABI page is showing the full file names as shown in [1], like "File
/srv/docbuild/lib/git/linux/stable/firewire-cdev", while only the file name
would be enough, like "File firewire-cdev".
By reverting this patch I got exactly the intended behavior, but it seems you
were fixing other things with this, so perhaps just reverting is breaking
something that I can't see.
Could you look into what would be the right fix for this? :)
Thanks,
Nícolas
[1] https://www.kernel.org/doc/html/latest/admin-guide/abi.html
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH v2 08/39] scripts: get_abi.pl: prevent duplicated file names
2020-10-30 7:40 [PATCH v2 00/39] ABI: add it to the documentation build system Mauro Carvalho Chehab
@ 2020-10-30 7:40 ` Mauro Carvalho Chehab
0 siblings, 0 replies; 2+ messages in thread
From: Mauro Carvalho Chehab @ 2020-10-30 7:40 UTC (permalink / raw)
To: Linux Doc Mailing List
Cc: Mauro Carvalho Chehab, Jonathan Corbet, Jonathan Cameron,
Oded Gabbay, Tom Rix, Vaibhav Jain, linux-kernel
The same filename may exist on multiple directories within
ABI. Create separate entries at the internal database for
each of them.
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
scripts/get_abi.pl | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/scripts/get_abi.pl b/scripts/get_abi.pl
index e5a5588a8639..5612f019fae0 100755
--- a/scripts/get_abi.pl
+++ b/scripts/get_abi.pl
@@ -65,7 +65,10 @@ sub parse_abi {
my $name = $file;
$name =~ s,.*/,,;
- my $nametag = "File $name";
+ my $fn = $file;
+ $fn =~ s,Documentation/ABI/,,;
+
+ my $nametag = "File $fn";
$data{$nametag}->{what} = "File $name";
$data{$nametag}->{type} = "File";
$data{$nametag}->{file} = $name;
@@ -320,16 +323,18 @@ sub output_rest {
my $fileref = "abi_file_".$path;
if ($type eq "File") {
- my $bar = $w;
- $bar =~ s/./-/g;
-
print ".. _$fileref:\n\n";
- print "$w\n$bar\n\n";
} else {
print "Defined on file :ref:`$f <$fileref>`\n\n";
}
}
+ if ($type eq "File") {
+ my $bar = $w;
+ $bar =~ s/./-/g;
+ print "$w\n$bar\n\n";
+ }
+
my $desc = "";
$desc = $data{$what}->{description} if (defined($data{$what}->{description}));
$desc =~ s/\s+$/\n/;
--
2.26.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-12-08 13:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-08 13:35 [PATCH v2 08/39] scripts: get_abi.pl: prevent duplicated file names Nícolas F. R. A. Prado
-- strict thread matches above, loose matches on Subject: below --
2020-10-30 7:40 [PATCH v2 00/39] ABI: add it to the documentation build system Mauro Carvalho Chehab
2020-10-30 7:40 ` [PATCH v2 08/39] scripts: get_abi.pl: prevent duplicated file names Mauro Carvalho Chehab
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).