develooper Front page | perl.perl5.porters | Postings from May 2003

[PATCH] for Configure -Dnoextensions=Encode

From:
Robin Barker
Date:
May 23, 2003 09:37
Subject:
[PATCH] for Configure -Dnoextensions=Encode
Message ID:
533D273D4014D411AB1D00062938C4D90404653D@hotel.npl.co.uk
I tried the new Configure option noextensions, as
	./Configure -Dnoextensions=Encode
and a number of test (that used Encode) failed!

This patch fixes the test (and open.pm) so the tests 
skip as necessary.

Appended and attached.

Robin

--- ../perl@19525/ext/PerlIO/t/encoding.t	Thu Jan 23 14:22:07 2003
+++ ./ext/PerlIO/t/encoding.t
@@ -10,6 +10,10 @@
 	print "1..0 # Skip: not perlio\n";
 	exit 0;
     }
+    unless (eval { require Encode } ) {
+	print "1..0 # Skip: not Encode\n";
+	exit 0;
+    }
 }
 
 print "1..14\n";
@@ -29,7 +33,6 @@
 }
 
 {
-    use Encode;
     open(my $i,'<:encoding(iso-8859-7)',$grk);
     print "ok 1\n";
     open(my $o,'>:utf8',$utf);
--- ../perl@19525/ext/PerlIO/t/fallback.t	Thu Jan 23 14:22:07 2003
+++ ./ext/PerlIO/t/fallback.t
@@ -10,9 +10,13 @@
 	print "1..0 # Skip: EBCDIC\n";
 	exit 0;
     }
+    unless( eval { require Encode } ) { 
+	print "1..0 # Skip: No Encode\n";
+	exit 0;
+    }
     plan (9);
+    import Encode qw(:fallback_all);
 }
-use Encode qw(:fallback_all);
 
 # $PerlIO::encoding = 0; # WARN_ON_ERR|PERLQQ;
 
--- ../perl@19525/ext/Storable/t/utf8hash.t
+++ ./ext/Storable/t/utf8hash.t
@@ -32,7 +32,6 @@
 # point Test::More tidily prints up 1..79 as if I meant to finish
there.
 use Test::More tests=>148;
 use bytes ();
-use Encode qw(is_utf8);
 my %utf8hash;
 
 $Storable::canonical = $Storable::canonical; # Shut up a used only once
warning.
--- ../perl@19525/lib/open.pm	Thu Apr 17 20:29:38 2003
+++ ./lib/open.pm
@@ -80,7 +80,7 @@
 	foreach my $layer (split(/\s+/,$dscp)) {
             $layer =~ s/^://;
 	    if ($layer eq 'locale') {
-		use Encode;
+		require Encode;
 		_get_locale_encoding()
 		    unless defined $locale_encoding;
 		(warnings::warnif("layer", "Cannot figure out an
encoding to use"), last)
--- ../perl@19525/lib/open.t	Thu Jan 23 14:22:59 2003
+++ ./lib/open.t
@@ -45,6 +45,7 @@
 
 SKIP: {
     skip("no perlio, no :utf8", 1) unless (find PerlIO::Layer
'perlio');
+    skip("no Encode for locale layer", 1) unless eval { require Encode
}; 
     # now load a real-looking locale
     $ENV{LC_ALL} = ' .utf8';
     import( 'IN', 'locale' );
End of patch



-------------------------------------------------------------------
This e-mail and any attachments may contain confidential and/or
privileged material; it is for the intended addressee(s) only.
If you are not a named addressee, you must not use, retain or
disclose such information.

NPL Management Ltd cannot guarantee that the e-mail or any
attachments are free from viruses.

NPL Management Ltd. Registered in England and Wales. No: 2937881
Registered Office: Teddington, Middlesex, United Kingdom TW11 0LW.
-------------------------------------------------------------------


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About