summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2017-03-11 11:50:58 -0700
committerKarl Williamson <khw@cpan.org>2017-06-01 06:33:17 -0600
commit272af0584dc7bd5ab0e8097878bd08ea604ac2e3 (patch)
treefc4fc77281e0116ba4c97977f6c45671ca3bdc93 /lib
parenta25d3b59702b551ace9e660fea69ff29d7909dd4 (diff)
downloadperl-272af0584dc7bd5ab0e8097878bd08ea604ac2e3.tar.gz
mktables: Fix up version compare
This is a feature that is used to compare 2 different Unicode versions for changes to existing code points, ignoring code points that aren't in the earlier version. It does this by removing the newly-added code points coming from the later version. One can then diff the generated directory structure against an existing one that was built under the old rules to see what changed. Prior to this commit, it assumed all version numbers were a single digit for the major number. This will no longer work for Unicode 10, about to be released. As part of the process, mktables adds blocks that didn't exist in the earlier version back to the unallocated pool. This gives better diff results. This commit does a better job of finding such blocks.
Diffstat (limited to 'lib')
-rw-r--r--lib/unicore/mktables21
1 files changed, 18 insertions, 3 deletions
diff --git a/lib/unicore/mktables b/lib/unicore/mktables
index e3336f50e0..d8ccd2b2d7 100644
--- a/lib/unicore/mktables
+++ b/lib/unicore/mktables
@@ -660,7 +660,7 @@ sub stack_trace() {
# common to both releases, and you can see the changes caused just by the
# underlying release semantic changes. For versions earlier than 3.2, you
# must copy a version of DAge.txt into the directory.
-my $string_compare_versions = DEBUG && 0; # e.g., "2.1";
+my $string_compare_versions = DEBUG && ""; # e.g., "2.1";
my $compare_versions = DEBUG
&& $string_compare_versions
&& pack "C*", split /\./, $string_compare_versions;
@@ -1529,7 +1529,7 @@ sub populate_char_info ($) {
$viacode[$i] = $perl_charname->value_of($i) || "";
$age[$i] = (defined $age)
- ? (($age->value_of($i) =~ / ^ \d \. \d $ /x)
+ ? (($age->value_of($i) =~ / ^ \d+ \. \d+ $ /x)
? $age->value_of($i)
: "")
: "";
@@ -5324,6 +5324,14 @@ use parent '-norequire', '_Range_List_Base';
return $self->_add_delete('+', @_);
}
+ sub replace_map {
+ # Replace a range
+
+ my $self = shift;
+
+ return $self->_add_delete('+', @_, Replace => $UNCONDITIONALLY);
+ }
+
sub add_duplicate {
# Adds entry to a range list which can duplicate an existing entry
@@ -7733,6 +7741,7 @@ END
# Accessors for the underlying list that should fail if locked.
for my $sub (qw(
add_duplicate
+ replace_map
))
{
no strict "refs";
@@ -9367,6 +9376,7 @@ sub trace { return main::trace(@_) if main::DEBUG && $to_trace }
range_count
ranges
range_size_1
+ replace_map
reset_each_range
set_comment
set_default_map
@@ -13898,8 +13908,10 @@ sub handle_compare_versions () {
# since the first compare version.
my $delta = Range_List->new();
foreach my $table ($age->tables) {
+ use version;
next if $table == $age->table('Unassigned');
- next if $table->name le $string_compare_versions;
+ next if version->parse($table->name)
+ le version->parse($string_compare_versions);
$delta += $table;
}
if ($delta->is_empty) {
@@ -13922,6 +13934,9 @@ sub handle_compare_versions () {
next if $this_block == $no_block
|| ! ($this_block & $Assigned)->is_empty;
$this_block->set_fate($SUPPRESSED, $after_first_version);
+ foreach my $range ($this_block->ranges) {
+ $block->replace_map($range->start, $range->end, 'No_Block')
+ }
$no_block += $this_block;
}