From: Richard Levitte Date: Thu, 8 Oct 2020 04:30:35 +0000 (+0200) Subject: Modify util/mknum.pl to drop new symbols that don't exist any more X-Git-Tag: openssl-3.0.0-alpha7~40 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a23163a3164897d0b370b31de824b9b020e85857;p=thirdparty%2Fopenssl.git 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 (Merged from https://github.com/openssl/openssl/pull/13092) --- diff --git a/util/mknum.pl b/util/mknum.pl index 4ee87c29a82..8f840ffe7f8 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"; } }