History

scripts/get_abi.pl: add a validate command

Sometimes, we just want the parser to retrieve all symbols from ABI, in order to check for parsing errors. So, add a new "validate" command. While here, update the man/help pages.

Mauro Carvalho Chehab committed 7 years ago

Commit 7ce7b891 parent 2c0700e1 file · +9 −7Browse files

Unified · Split

scripts/get_abi.pl+9−7
@@ -25,7 +25,7 @@ pod2usage(2) if (scalar @ARGV < 1 || @ARGV > 2); · 24 unmodified lines
25 25
26my ($cmd, $arg) = @ARGV;26my ($cmd, $arg) = @ARGV;
27 27
28pod2usage(2) if ($cmd ne "search" && $cmd ne "rest");28pod2usage(2) if ($cmd ne "search" && $cmd ne "rest" && $cmd ne "validate");
29pod2usage(2) if ($cmd eq "search" && !$arg);29pod2usage(2) if ($cmd eq "search" && !$arg);
30 30
31require Data::Dumper if ($debug);31require Data::Dumper if ($debug);
@@ -82,7 +82,7 @@ sub parse_abi { · 50 unmodified lines
82 my $sep = $2;82 my $sep = $2;
83 my $content = $3;83 my $content = $3;
84 84
85 if (!($new_tag =~ m/(what|date|kernelversion|contact|description|users)/)) {85 if (!($new_tag =~ m/(what|where|date|kernelversion|contact|description|users)/)) {
86 if ($tag eq "description") {86 if ($tag eq "description") {
87 # New "tag" is actually part of87 # New "tag" is actually part of
88 # description. Don't consider it a tag88 # description. Don't consider it a tag
@@ -368,7 +368,7 @@ print STDERR Data::Dumper->Dump([\%data], [qw(*data)]) if ($debug); · 279 unmodified lines
368#368#
369if ($cmd eq "rest") {369if ($cmd eq "rest") {
370 output_rest;370 output_rest;
371} else {371} elsif ($cmd eq "search") {
372 search_symbols;372 search_symbols;
373}373}
374 374
@@ -381,7 +381,7 @@ abi_book.pl - parse the Linux ABI files and produce a ReST book. · 6 unmodified lines
381 381
382=head1 SYNOPSIS382=head1 SYNOPSIS
383 383
384B<abi_book.pl> [--debug] <COMAND> [<ARGUMENT>]384B<abi_book.pl> [--debug] [--man] [--help] [--dir=<dir>] <COMAND> [<ARGUMENT>]
385 385
386Where <COMMAND> can be:386Where <COMMAND> can be:
387 387
@@ -389,7 +389,9 @@ Where <COMMAND> can be: · 1 unmodified line
389 389
390B<search> [SEARCH_REGEX] - search for [SEARCH_REGEX] inside ABI390B<search> [SEARCH_REGEX] - search for [SEARCH_REGEX] inside ABI
391 391
392B<rest> - output the ABI in ReST markup language392B<rest> - output the ABI in ReST markup language
393
394B<validate> - validate the ABI contents
393 395
394=back396=back
395 397
@@ -451,11 +453,11 @@ $ scripts/get_abi.pl rest --dir Documentation/ABI/obsolete · 55 unmodified lines
451 453
452=head1 BUGS454=head1 BUGS
453 455
454Report bugs to Mauro Carvalho Chehab <mchehab@s-opensource.com>456Report bugs to Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
455 457
456=head1 COPYRIGHT458=head1 COPYRIGHT
457 459
458Copyright (c) 2016-2017 by Mauro Carvalho Chehab <mchehab@s-opensource.com>.460Copyright (c) 2016-2019 by Mauro Carvalho Chehab <mchehab+samsung@kernel.org>.
459 461
460License GPLv2: GNU GPL version 2 <http://gnu.org/licenses/gpl.html>.462License GPLv2: GNU GPL version 2 <http://gnu.org/licenses/gpl.html>.
461 463