aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-10-08 06:30:35 +0200
committerRichard Levitte <levitte@openssl.org>2020-10-09 10:19:47 +0200
commita23163a3164897d0b370b31de824b9b020e85857 (patch)
tree7b7d84b3221bf870893aede4c0c6e203845645e5 /util
parent0c12ca7294ac887d3d07a3294d1ee7c35a2be7e4 (diff)
downloadopenssl-a23163a3164897d0b370b31de824b9b020e85857.zip
openssl-a23163a3164897d0b370b31de824b9b020e85857.tar.gz
openssl-a23163a3164897d0b370b31de824b9b020e85857.tar.bz2
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.pl22
1 files changed, 17 insertions, 5 deletions
diff --git a/util/mknum.pl b/util/mknum.pl
index 4ee87c2..8f840ff 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";
}
}