Change 30309 by [EMAIL PROTECTED] on 2007/02/14 23:53:19

        Integrate:
        [ 28043]
        Fix for RT #7916: perl 5.6.1 with Intel's icc on RedHat 
        Linux 7.2.  The original fix, change #13053, added a check
        for $Config{gccversion} which is now populated by newer
        Intel compilers.  This additional change checks to see
        if Intel is in $Config{gccversion}.  If it is, its not
        a gcc.
        
        [ 28046]
        One too many ('s in change #28043. 
        
        [ 28794]
        Convert Errno.t to Test::More.  Increase the test coverage
        while in there as well. 
        
        [ 29558]
        Subject: Re: [PATCH] Errno doesnt rebuild when things it depends on in 
Config.pm change
        From: demerphq <[EMAIL PROTECTED]>
        Date: Fri, 15 Dec 2006 12:52:45 +0100
        Message-ID: <[EMAIL PROTECTED]>
        
        [ 29595]
        Proper cleanup for Errno.pm
        
        [ 29627]
        Upgrade to Errno-1.10 (!).  I have left the core tests as is for
        now as well as for Makefile.PL, which need some looking into.

Affected files ...

... //depot/maint-5.8/perl/ext/Errno/ChangeLog#2 integrate
... //depot/maint-5.8/perl/ext/Errno/Errno_pm.PL#10 integrate
... //depot/maint-5.8/perl/ext/Errno/Makefile.PL#2 integrate
... //depot/maint-5.8/perl/ext/Errno/t/Errno.t#4 integrate

Differences ...

==== //depot/maint-5.8/perl/ext/Errno/ChangeLog#2 (text) ====
Index: perl/ext/Errno/ChangeLog
--- perl/ext/Errno/ChangeLog#1~17645~   2002-07-19 12:29:57.000000000 -0700
+++ perl/ext/Errno/ChangeLog    2007-02-14 15:53:19.000000000 -0800
@@ -1,3 +1,8 @@
+Errno 1.10 -- Wed Dec 27 08:20:29 CST 2006
+
+ * Update with all changes made to core perl repository
+
+
 Change 171 on 2000-09-12 by <[EMAIL PROTECTED]> (Calle Dybedahl)
 
        - Fixed filename-extracting regexp to allow whitespace between

==== //depot/maint-5.8/perl/ext/Errno/Errno_pm.PL#10 (text) ====
Index: perl/ext/Errno/Errno_pm.PL
--- perl/ext/Errno/Errno_pm.PL#9~30226~ 2007-02-12 06:48:32.000000000 -0800
+++ perl/ext/Errno/Errno_pm.PL  2007-02-14 15:53:19.000000000 -0800
@@ -2,11 +2,16 @@
 use Config;
 use strict;
 
-our $VERSION = "1.09_01";
+our $VERSION = "1.10";
 
 my %err = ();
 my %wsa = ();
 
+# Symbian cross-compiling environment.
+my $IsSymbian = exists $ENV{SDK} && -d "$ENV{SDK}\\epoc32";
+
+my $IsMSWin32 = $^O eq 'MSWin32' && !$IsSymbian;
+
 unlink "Errno.pm" if -f "Errno.pm";
 open OUT, ">Errno.pm" or die "Cannot open Errno.pm: $!";
 select OUT;
@@ -45,7 +50,7 @@
     }
 
     return unless defined $file and -f $file;
-#   warn "Processing $file\n";
+#    warn "Processing $file\n";
 
     local *FH;
     if (($^O eq 'VMS') && ($Config{vms_cc_type} ne 'gnuc')) {
@@ -71,7 +76,7 @@
             return;
        }
     }
-
+    
     if ($^O eq 'MacOS') {
        while(<FH>) {
            $err{$1} = $2
@@ -81,12 +86,13 @@
        while(<FH>) {
            $err{$1} = 1
                if /^\s*#\s*define\s+(E\w+)\s+/;
-            if ($^O eq 'MSWin32') {
+            if ($IsMSWin32) {
                $wsa{$1} = 1
                    if /^\s*#\s*define\s+WSA(E\w+)\s+/;
             }
        }
     }
+
     close(FH);
 }
 
@@ -135,7 +141,9 @@
             $file{$1} = 1;
        }
     } elsif ($^O eq 'linux' &&
-            $Config{gccversion} ne '' # might be using, say, Intel's icc
+             $Config{gccversion} ne '' && 
+             $Config{gccversion} !~ /intel/i
+             # might be using, say, Intel's icc
             ) {
        # Some Linuxes have weird errno.hs which generate
        # no #file or #line directives
@@ -154,6 +162,10 @@
     } elsif ($^O eq 'vos') {
        # avoid problem where cpp returns non-POSIX pathnames
        $file{'/system/include_library/errno.h'} = 1;
+    } elsif ($IsSymbian) {
+        my $SDK = $ENV{SDK};
+        $SDK =~ s!\\!/!g;
+       $file{"$SDK/epoc32/include/libc/sys/errno.h"} = 1;
     } else {
        open(CPPI,"> errno.c") or
            die "Cannot open errno.c";
@@ -162,7 +174,7 @@
            print CPPI "#include <nwerrno.h>\n";
        } else {
            print CPPI "#include <errno.h>\n";
-           if ($^O eq 'MSWin32') {
+           if ($IsMSWin32) {
                print CPPI "#define _WINSOCKAPI_\n"; # don't drag in everything
                print CPPI "#include <winsock.h>\n";
            }
@@ -171,7 +183,7 @@
        close(CPPI);
 
        # invoke CPP and read the output
-       if ($^O eq 'MSWin32' || $^O eq 'NetWare') {
+       if ($IsMSWin32 || $^O eq 'NetWare') {
            open(CPPO,"$Config{cpprun} $Config{cppflags} errno.c |") or
                die "Cannot run '$Config{cpprun} $Config{cppflags} errno.c'";
        } else {
@@ -181,14 +193,14 @@
        }
 
        my $pat;
-       if (($^O eq 'MSWin32' || $^O eq 'NetWare') and $Config{cc} =~ /^bcc/i) {
+       if (($IsMSWin32 || $^O eq 'NetWare') and $Config{cc} =~ /^bcc/i) {
            $pat = '^/\*\s+(.+)\s+\d+\s*:\s+\*/';
        }
        else {
            $pat = '^#\s*(?:line)?\s*\d+\s+"([^"]+)"';
        }
        while(<CPPO>) {
-           if ($^O eq 'os2' or $^O eq 'MSWin32' or $^O eq 'NetWare') {
+           if ($^O eq 'os2' or $IsMSWin32 or $^O eq 'NetWare') {
                if (/$pat/o) {
                   my $f = $1;
                   $f =~ s,\\\\,/,g;
@@ -222,7 +234,7 @@
     else {
        print CPPI "#include <errno.h>\n";
     }
-    if ($^O eq 'MSWin32') {
+    if ($IsMSWin32) {
        print CPPI "#include <winsock.h>\n";
        foreach $err (keys %wsa) {
            print CPPI "#ifndef $err\n";
@@ -246,10 +258,14 @@
            $cpp =~ s/sys\$input//i;
            open(CPPO,"$cpp  errno.c |") or
                die "Cannot exec $Config{cppstdin}";
-       } elsif ($^O eq 'MSWin32' || $^O eq 'NetWare') {
+       } elsif ($IsMSWin32 || $^O eq 'NetWare') {
            open(CPPO,"$Config{cpprun} $Config{cppflags} errno.c |") or
                die "Cannot run '$Config{cpprun} $Config{cppflags} errno.c'";
-       } else {
+       } elsif ($IsSymbian) {
+            my $cpp = "gcc -E -I$ENV{SDK}\\epoc32\\include\\libc -";
+           open(CPPO,"$cpp < errno.c |")
+               or die "Cannot exec $cpp";
+        } else {
            my $cpp = default_cpp();
            open(CPPO,"$cpp < errno.c |")
                or die "Cannot exec $cpp";

==== //depot/maint-5.8/perl/ext/Errno/Makefile.PL#2 (text) ====
Index: perl/ext/Errno/Makefile.PL
--- perl/ext/Errno/Makefile.PL#1~17645~ 2002-07-19 12:29:57.000000000 -0700
+++ perl/ext/Errno/Makefile.PL  2007-02-14 15:53:19.000000000 -0800
@@ -1,14 +1,33 @@
 use ExtUtils::MakeMaker;
+use Config;
 
 @VMS = ($^O eq 'VMS') ? (MAN3PODS => {}) : ();
 
+my $arch = "$Config{'archname'}-$Config{'osvers'}";
+my $got = "";
+if (-e 'arch.txt') {
+    open my $in, "<", "arch.txt" or die "Can't read 'arch.txt': $!";
+    $got = <$in>;
+    close $in;
+}
+if ($got ne $arch) {
+    if (-e "Errno.pm") {
+        print "Removing old 'Errno.pm'\n";
+        unlink "Errno.pm" 
+            or die "Failed to remove out of date 'Errno.pm': $!";
+    }
+    open my $out, ">", "arch.txt" or die "Can't write 'arch.txt': $!";
+    print $out $arch;
+    close $out;
+}
+
 WriteMakefile(
     NAME        => 'Errno',
     VERSION_FROM => 'Errno_pm.PL',
     MAN3PODS     => {},        # Pods will be built by installman.
     PL_FILES    => {'Errno_pm.PL'=>'Errno.pm'},
     PM          => {'Errno.pm' => '$(INST_LIBDIR)/Errno.pm'},
-    'clean'     => {FILES => 'Errno.pm'},
+    'clean'     => {FILES => 'Errno.pm arch.txt'},
     'dist'      => {
        COMPRESS => 'gzip -9f',
        SUFFIX   => '.gz', 

==== //depot/maint-5.8/perl/ext/Errno/t/Errno.t#4 (xtext) ====
Index: perl/ext/Errno/t/Errno.t
--- perl/ext/Errno/t/Errno.t#3~23458~   2004-11-01 05:39:35.000000000 -0800
+++ perl/ext/Errno/t/Errno.t    2007-02-14 15:53:19.000000000 -0800
@@ -1,4 +1,4 @@
-#!./perl
+#!./perl -w
 
 BEGIN {
     unless(grep /blib/, @INC) {
@@ -11,48 +11,37 @@
     }
 }
 
-use Errno;
+use Test::More tests => 10;
 
-print "1..6\n";
+BEGIN {
+    use_ok("Errno");
+}
 
-print "not " unless @Errno::EXPORT_OK;
-print "ok 1\n";
-die unless @Errno::EXPORT_OK;
+BAIL_OUT("No errno's are exported") unless @Errno::EXPORT_OK;
 
-$err = $Errno::EXPORT_OK[0];
-$num = &{"Errno::$err"};
+my $err = $Errno::EXPORT_OK[0];
+my $num = &{"Errno::$err"};
 
-print "not " unless &{"Errno::$err"} == $num;
-print "ok 2\n";
+is($num, &{"Errno::$err"});
 
 $! = $num;
-# Some systems have ESUCCESS 0, that's why exists instead of boolean.
-print "not " unless exists $!{$err};
-print "ok 3\n";
+ok(exists $!{$err});
 
 $! = 0;
-print "not " if $!{$err};
-print "ok 4\n";
+ok(! $!{$err});
 
-$s1 = join(",",sort keys(%!));
-$s2 = join(",",sort @Errno::EXPORT_OK);
+ok(join(",",sort keys(%!)) eq join(",",sort @Errno::EXPORT_OK));
 
-if($s1 ne $s2) {
-    my @s1 = keys(%!);
-    my @s2 = @Errno::EXPORT_OK;
-    my(%s1,%s2);
-    @[EMAIL PROTECTED] = ();
-    @[EMAIL PROTECTED] = ();
-    delete @[EMAIL PROTECTED];
-    delete @[EMAIL PROTECTED];
-    print "# These are only in \%!\n";
-    print "# ",join(" ",map { "'$_'" } keys %s1),"\n";
-    print "# These are only in [EMAIL PROTECTED]";
-    print "# ",join(" ",map { "'$_'" } keys %s2),"\n";
-    print "not ";
-}
+eval { exists $!{[]} };
+ok(! $@);
 
-print "ok 5\n";
+eval {$!{$err} = "qunckkk" };
+like($@, qr/^ERRNO hash is read only!/);
 
-eval { exists $!{[]} };
-print $@ ? "not ok 6\n" : "ok 6\n";
+eval {delete $!{$err}};
+like($@, qr/^ERRNO hash is read only!/);
+
+# The following tests are in trouble if some OS picks errno values
+# through Acme::MetaSyntactic::batman
+is($!{EFLRBBB}, "");
+ok(! exists($!{EFLRBBB}));
End of Patch.

Reply via email to