diff options
author | Richard Levitte <levitte@openssl.org> | 2020-10-08 06:30:35 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-10-09 10:19:47 +0200 |
commit | a23163a3164897d0b370b31de824b9b020e85857 (patch) | |
tree | 7b7d84b3221bf870893aede4c0c6e203845645e5 /util | |
parent | 0c12ca7294ac887d3d07a3294d1ee7c35a2be7e4 (diff) |
Modify util/mknum.pl to drop new symbols that don't exist any more
This makes use of the writer filters in OpenSSL::Ordinals.
Fixes #10395
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/13092)
Diffstat (limited to 'util')
-rw-r--r-- | util/mknum.pl | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/util/mknum.pl b/util/mknum.pl index 4ee87c29a8..8f840ffe7f 100644 --- a/util/mknum.pl +++ b/util/mknum.pl @@ -118,7 +118,15 @@ if ($checkexist) { } } } else { - $ordinals->rewrite(); + my $dropped = 0; + my $unassigned; + my $filter = sub { + my $item = shift; + my $result = $item->number() ne '?' || $item->exists(); + $dropped++ unless $result; + return $result; + }; + $ordinals->rewrite(filter => $filter); my %stats = $ordinals->stats(); print STDERR "${ordinals_file}: $stats{modified} old symbols have updated info\n" @@ -128,9 +136,13 @@ if ($checkexist) { } else { print STDERR "${ordinals_file}: No new symbols added\n"; } - if ($stats{unassigned}) { - my $symbol = $stats{unassigned} == 1 ? "symbol" : "symbols"; - my $is = $stats{unassigned} == 1 ? "is" : "are"; - print STDERR "${ordinals_file}: $stats{unassigned} $symbol $is without ordinal number\n"; + if ($dropped) { + print STDERR "${ordinals_file}: Dropped $dropped new symbols\n"; + } + $unassigned = $stats{unassigned} - $dropped; + if ($unassigned) { + my $symbol = $unassigned == 1 ? "symbol" : "symbols"; + my $is = $unassigned == 1 ? "is" : "are"; + print STDERR "${ordinals_file}: $unassigned $symbol $is without ordinal number\n"; } } |