This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
mktables: Minimize use of version numbers for decisions
authorKarl Williamson <khw@cpan.org>
Wed, 29 Jul 2015 02:52:57 +0000 (20:52 -0600)
committerKarl Williamson <khw@cpan.org>
Wed, 29 Jul 2015 04:15:58 +0000 (22:15 -0600)
I found these places where file existence can be used instead of knowing
what version something happened in.  Sometimes those numbers are wrong,
and one of these was.  If it can be avoided, better not to use version
numbers

charclass_invlists.h
lib/unicore/mktables
regcharclass.h

index 9e91e6a..64406bf 100644 (file)
@@ -99537,7 +99537,7 @@ static const UV XPosixXDigit_invlist[] = { /* for EBCDIC POSIX-BC */
  * 1a0687fb9c6c4567e853913549df0944fe40821279a3e9cdaa6ab8679bc286fd lib/unicore/extracted/DLineBreak.txt
  * 40bcfed3ca727c19e1331f6c33806231d5f7eeeabd2e6a9e06a3740c85d0c250 lib/unicore/extracted/DNumType.txt
  * a18d502bad39d527ac5586d7bc93e29f565859e3bcc24ada627eff606d6f5fed lib/unicore/extracted/DNumValues.txt
- * 21a45dbd06b4e82a0fc65092e91a0fe64a9f26ef37c89a7edcf26439a6f35e30 lib/unicore/mktables
+ * 46f739fb5c9daf6fb457ed67f821d88d9eadd2df17b098f385b3b50f99c01acf lib/unicore/mktables
  * 462c9aaa608fb2014cd9649af1c5c009485c60b9c8b15b89401fdc10cf6161c6 lib/unicore/version
  * c6884f4d629f04d1316f3476cb1050b6a1b98ca30c903262955d4eae337c6b1e regen/charset_translations.pl
  * 8a097f8f726bb1619af2f27f149ab87e60a1602f790147e3a561358be16abd27 regen/mk_invlists.pl
index 5f06431..27cb45a 100644 (file)
@@ -1524,7 +1524,7 @@ sub populate_char_info ($) {
         elsif ($gc-> table('Unassigned')->contains($i)) {
             $annotate_char_type[$i] = $UNASSIGNED_TYPE;
             $printable[$i] = 0;
-            if ($v_version lt v2.0.0) { # No blocks in earliest releases
+            if (defined $block) { # No blocks in earliest releases
                 $viacode[$i] = 'Unassigned';
                 $end = $gc-> table('Unassigned')->containing_range($i)->end;
             }
@@ -9851,7 +9851,7 @@ sub process_PropertyAliases($) {
 
         # This line is defective in early Perls.  The property in Unihan.txt
         # is kRSUnicode.
-        if ($v_version lt v5.2.0 && $full eq 'Unicode_Radical_Stroke') {
+        if ($full eq 'Unicode_Radical_Stroke' && @data < 3) {
             push @data, qw(cjkRSUnicode kRSUnicode);
         }
 
@@ -10001,7 +10001,7 @@ sub finish_property_setup {
     # for non-assigned code points; 'AL' for assigned.
     if (file_exists("${EXTRACTED}DLineBreak.txt") || -e 'LineBreak.txt') {
         my $lb = property_ref('Line_Break');
-        if ($v_version gt 3.2.0) {
+        if (file_exists("${EXTRACTED}DLineBreak.txt")) {
             $lb->set_default_map('Unknown');
         }
         else {
index 9774ab5..f7cd2fd 100644 (file)
  * 1a0687fb9c6c4567e853913549df0944fe40821279a3e9cdaa6ab8679bc286fd lib/unicore/extracted/DLineBreak.txt
  * 40bcfed3ca727c19e1331f6c33806231d5f7eeeabd2e6a9e06a3740c85d0c250 lib/unicore/extracted/DNumType.txt
  * a18d502bad39d527ac5586d7bc93e29f565859e3bcc24ada627eff606d6f5fed lib/unicore/extracted/DNumValues.txt
- * 21a45dbd06b4e82a0fc65092e91a0fe64a9f26ef37c89a7edcf26439a6f35e30 lib/unicore/mktables
+ * 46f739fb5c9daf6fb457ed67f821d88d9eadd2df17b098f385b3b50f99c01acf lib/unicore/mktables
  * 462c9aaa608fb2014cd9649af1c5c009485c60b9c8b15b89401fdc10cf6161c6 lib/unicore/version
  * c6884f4d629f04d1316f3476cb1050b6a1b98ca30c903262955d4eae337c6b1e regen/charset_translations.pl
  * d9c04ac46bdd81bb3e26519f2b8eb6242cb12337205add3f7cf092b0c58dccc4 regen/regcharclass.pl