mktables: Allow Unicode Unihan files to compile
authorKarl Williamson <public@khwilliamson.com>
Fri, 28 Feb 2014 16:58:33 +0000 (09:58 -0700)
committerKarl Williamson <public@khwilliamson.com>
Sun, 2 Mar 2014 03:12:16 +0000 (20:12 -0700)
Perl normally doesn't include the Unicode Unihan files, but someone is
free to recompile Perl with these.  However, starting with commit
9e65c3f47e483ee7e33b5d748a06f4addd830d60, mktables checks for the
version number on the input files and refuses to compile if incorrect.
(This is to catch Perl trying to compile from a DB with inconsistent
files; I believe Perl used to be shipped with these synchronization
errors.)  However, the Unihan files in Unicode 6.3 do not have the same
syntax as the rest of the files, so since that commit Perl refuses to
compile Unihan.

The files are being updated in 7.0 to use the same syntax as the rest,
so rather than hard-code the current syntax as an exception into
mktables, this just skips checking these files until 7.0.

lib/unicore/mktables

index 5da1d7c..88c9746 100644 (file)
@@ -2502,7 +2502,12 @@ END
             }
             $handle{$addr} = $file_handle; # Cache the open file handle
 
-            if ($v_version ge v3.2.0 && lc($file) ne 'unicodedata.txt') {
+            if ($v_version ge v3.2.0
+                && lc($file) ne 'unicodedata.txt'
+
+                    # Unihan files used another format until v7
+                && ($v_version ge v7.0.0 || $file !~ /^Unihan/i))
+            {
                 $_ = <$file_handle>;
                 if ($_ !~ / - $string_version \. /x) {
                     chomp;