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
2525
2626 my ($cmd, $arg) = @ARGV;
2727
28−pod2usage(2) if ($cmd ne "search" && $cmd ne "rest");
28+pod2usage(2) if ($cmd ne "search" && $cmd ne "rest" && $cmd ne "validate");
2929 pod2usage(2) if ($cmd eq "search" && !$arg);
3030
3131 require Data::Dumper if ($debug);
@@ -82,7 +82,7 @@ sub parse_abi { · 50 unmodified lines
8282 my $sep = $2;
8383 my $content = $3;
8484
85− if (!($new_tag =~ m/(what|date|kernelversion|contact|description|users)/)) {
85+ if (!($new_tag =~ m/(what|where|date|kernelversion|contact|description|users)/)) {
8686 if ($tag eq "description") {
8787 # New "tag" is actually part of
8888 # description. Don't consider it a tag
@@ -368,7 +368,7 @@ print STDERR Data::Dumper->Dump([\%data], [qw(*data)]) if ($debug); · 279 unmodified lines
368368 #
369369 if ($cmd eq "rest") {
370370 output_rest;
371−} else {
371+} elsif ($cmd eq "search") {
372372 search_symbols;
373373 }
374374
@@ -381,7 +381,7 @@ abi_book.pl - parse the Linux ABI files and produce a ReST book. · 6 unmodified lines
381381
382382 =head1 SYNOPSIS
383383
384−B<abi_book.pl> [--debug] <COMAND> [<ARGUMENT>]
384+B<abi_book.pl> [--debug] [--man] [--help] [--dir=<dir>] <COMAND> [<ARGUMENT>]
385385
386386 Where <COMMAND> can be:
387387
@@ -389,7 +389,9 @@ Where <COMMAND> can be: · 1 unmodified line
389389
390390 B<search> [SEARCH_REGEX] - search for [SEARCH_REGEX] inside ABI
391391
392−B<rest> - output the ABI in ReST markup language
392+B<rest> - output the ABI in ReST markup language
393+
394+B<validate> - validate the ABI contents
393395
394396 =back
395397
@@ -451,11 +453,11 @@ $ scripts/get_abi.pl rest --dir Documentation/ABI/obsolete · 55 unmodified lines
451453
452454 =head1 BUGS
453455
454−Report bugs to Mauro Carvalho Chehab <mchehab@s-opensource.com>
456+Report bugs to Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
455457
456458 =head1 COPYRIGHT
457459
458−Copyright (c) 2016-2017 by Mauro Carvalho Chehab <mchehab@s-opensource.com>.
460+Copyright (c) 2016-2019 by Mauro Carvalho Chehab <mchehab+samsung@kernel.org>.
459461
460462 License GPLv2: GNU GPL version 2 <http://gnu.org/licenses/gpl.html>.
461463