From: Jarkko Hietaniemi Date: Tue, 10 Jun 2003 05:27:33 +0000 (+0000) Subject: Upgrade to Unicode::Normalize 0.22. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1efaba7f56949957e2b13a8f2a59502184204c6d;p=p5sagit%2Fp5-mst-13.2.git Upgrade to Unicode::Normalize 0.22. p4raw-id: //depot/perl@19735 --- diff --git a/ext/Unicode/Normalize/Changes b/ext/Unicode/Normalize/Changes index 92b944e..9772a52 100644 --- a/ext/Unicode/Normalize/Changes +++ b/ext/Unicode/Normalize/Changes @@ -1,5 +1,8 @@ Revision history for Perl extension Unicode::Normalize. +0.22 Mon Jun 09 22:23:10 2003 + - internal tweak (again): pack_U() and unpack_U(). + 0.21 Thu Apr 02 23:12:54 2003 - internal tweak: for (?un)pack 'U'. diff --git a/ext/Unicode/Normalize/Makefile.PL b/ext/Unicode/Normalize/Makefile.PL index d37906a..8688132 100644 --- a/ext/Unicode/Normalize/Makefile.PL +++ b/ext/Unicode/Normalize/Makefile.PL @@ -1,27 +1,47 @@ use ExtUtils::MakeMaker; -# This is not the CPAN Unicode::Normalize makefile -# that can handle XS-NOXS installing. We do just XS. +# This code for XS-NOXS installer is shamelessly stolen +# after Gurusamy Sarathy's Data::Dumper. Thank you! -do "mkheader"; +# a bit modified. -unless($ENV{PERL_CORE}) { - $ENV{PERL_CORE} = 1 if grep { $_ eq 'PERL_CORE=1' } @ARGV; +use File::Copy qw(); + +my $arg = $ARGV[0] || ""; + +if ($arg =~ /^no/i and -f "Normalize.xs") { + print STDERR "Disabling XS in sources...\n"; + + die "***** Failed, sources could be inconsistent! *****\n" + unless File::Copy::move('MANIFEST', 'MANIFEST.XS') + and File::Copy::move('MANIFEST.NXS', 'MANIFEST') + and File::Copy::move('Normalize.pm', 'Normalize.pm.XS') + and File::Copy::move('Normalize.xs', 'Normalize.xs.XS') + and File::Copy::move('Normalize.pm.NXS','Normalize.pm'); } -if ($ENV{PERL_CORE}) { - # Pods will be built by installman. - @coreopts = ( MAN3PODS => {} ); +if ($arg =~ /^xs/i and -f "Normalize.xs.XS") { + print STDERR "Enabling XS in sources...\n"; + + die "***** Failed, sources could be inconsistent! *****\n" + unless File::Copy::move('MANIFEST', 'MANIFEST.NXS') + and File::Copy::move('MANIFEST.XS', 'MANIFEST') + and File::Copy::move('Normalize.pm', 'Normalize.pm.NXS') + and File::Copy::move('Normalize.xs.XS', 'Normalize.xs') + and File::Copy::move('Normalize.pm.XS', 'Normalize.pm'); } -else { - @coreopts = (); + +my $clean = {}; + +if (-f "Normalize.xs") { + print STDERR "Making header files for XS...\n"; + + do "mkheader"; + $clean = { FILES => 'unfcan.h unfcmb.h unfcmp.h unfcpt.h unfexc.h' }; } WriteMakefile( + 'INSTALLDIRS' => $] > 5.007 ? 'perl' : 'site', 'NAME' => 'Unicode::Normalize', 'VERSION_FROM' => 'Normalize.pm', # finds $VERSION - ($] >= 5.005 ? ## Add these new keywords supported since 5.005 - (ABSTRACT_FROM => 'Normalize.pm', # retrieve abstract from module - AUTHOR => 'SADAHIRO Tomoyuki ') : ()), - clean => {FILES=> 'unfcan.h unfcmb.h unfcmp.h unfcpt.h unfexc.h'}, - @coreopts, + 'clean' => $clean, ); diff --git a/ext/Unicode/Normalize/Normalize.pm b/ext/Unicode/Normalize/Normalize.pm index 7dbe42e..eb6f3d9 100644 --- a/ext/Unicode/Normalize/Normalize.pm +++ b/ext/Unicode/Normalize/Normalize.pm @@ -1,7 +1,7 @@ package Unicode::Normalize; BEGIN { - unless ("A" eq pack('U', 0x41) || "A" eq pack('U', ord("A"))) { + unless ("A" eq pack('U', 0x41)) { die "Unicode::Normalize cannot stringify a Unicode code point\n"; } } @@ -11,7 +11,7 @@ use strict; use warnings; use Carp; -our $VERSION = '0.21'; +our $VERSION = '0.22'; our $PACKAGE = __PACKAGE__; require Exporter; diff --git a/ext/Unicode/Normalize/Normalize.xs b/ext/Unicode/Normalize/Normalize.xs index a75f74d..4989895 100644 --- a/ext/Unicode/Normalize/Normalize.xs +++ b/ext/Unicode/Normalize/Normalize.xs @@ -361,7 +361,7 @@ compose(arg) } /* preCC not changed to curCC */ uvS = uvComp; - } else if (! curCC && p < e) { /* blocked */ + } else if (! curCC && p < e) { /* blocked */ break; } else { preCC = curCC; diff --git a/ext/Unicode/Normalize/README b/ext/Unicode/Normalize/README index 8447502..5392df4 100644 --- a/ext/Unicode/Normalize/README +++ b/ext/Unicode/Normalize/README @@ -1,4 +1,4 @@ -Unicode/Normalize version 0.21 +Unicode/Normalize version 0.22 =================================== Unicode::Normalize - Unicode Normalization Forms @@ -24,7 +24,7 @@ SYNOPSIS INSTALLATION -Perl 5.6 or later +Perl 5.6.1 or later To install this module type the following: diff --git a/ext/Unicode/Normalize/mkheader b/ext/Unicode/Normalize/mkheader index e2c4f12..4da4d07 100644 --- a/ext/Unicode/Normalize/mkheader +++ b/ext/Unicode/Normalize/mkheader @@ -16,7 +16,7 @@ use Carp; use File::Spec; BEGIN { - unless ("A" eq pack('U', 0x41) || "A" eq pack('U', ord("A"))) { + unless ("A" eq pack('U', 0x41)) { die "Unicode::Normalize cannot stringify a Unicode code point\n"; } } @@ -202,11 +202,7 @@ foreach my $key (keys %Compat) { } sub _pack_U { - return "A" eq pack('U', 0x41) - ? pack('U*', @_) - : "A" eq pack('U', ord("A")) - ? pack('U*', map utf8::unicode_to_native($_), @_) - : die "$PACKAGE, a Unicode code point cannot be stringified.\n"; + return pack('U*', @_); } sub _U_stringify { diff --git a/ext/Unicode/Normalize/t/func.t b/ext/Unicode/Normalize/t/func.t index 81e092a..6dbf41b 100644 --- a/ext/Unicode/Normalize/t/func.t +++ b/ext/Unicode/Normalize/t/func.t @@ -1,6 +1,6 @@ BEGIN { - unless ("A" eq pack('U', 0x41) || "A" eq pack('U', ord("A"))) { + unless ("A" eq pack('U', 0x41)) { print "1..0 # Unicode::Normalize " . "cannot stringify a Unicode code point\n"; exit 0; diff --git a/ext/Unicode/Normalize/t/norm.t b/ext/Unicode/Normalize/t/norm.t index 76ee255..90c037a 100644 --- a/ext/Unicode/Normalize/t/norm.t +++ b/ext/Unicode/Normalize/t/norm.t @@ -1,6 +1,6 @@ BEGIN { - unless ("A" eq pack('U', 0x41) || "A" eq pack('U', ord("A"))) { + unless ("A" eq pack('U', 0x41)) { print "1..0 # Unicode::Normalize " . "cannot stringify a Unicode code point\n"; exit 0; diff --git a/ext/Unicode/Normalize/t/test.t b/ext/Unicode/Normalize/t/test.t index b98a8b8..c5ebf3a 100644 --- a/ext/Unicode/Normalize/t/test.t +++ b/ext/Unicode/Normalize/t/test.t @@ -1,6 +1,6 @@ BEGIN { - unless ("A" eq pack('U', 0x41) || "A" eq pack('U', ord("A"))) { + unless ("A" eq pack('U', 0x41)) { print "1..0 # Unicode::Normalize " . "cannot stringify a Unicode code point\n"; exit 0;