4240841
diff -up perl-5.12.3/cpan/ExtUtils-ParseXS/Changes.22206 perl-5.12.3/cpan/ExtUtils-ParseXS/Changes
4240841
--- perl-5.12.3/cpan/ExtUtils-ParseXS/Changes.22206	2011-01-09 15:20:53.000000000 -0500
4240841
+++ perl-5.12.3/cpan/ExtUtils-ParseXS/Changes	2011-01-26 16:15:45.072549003 -0500
4240841
@@ -1,5 +1,73 @@
4240841
 Revision history for Perl extension ExtUtils::ParseXS.
4240841
 
4240841
+2.2206 - Sun Jul  4 15:43:21 EDT 2010
4240841
+
4240841
+ Bug fixes:
4240841
+
4240841
+ - Make xsubpp accept the _ prototype (RT#57157) [Rafael Garcia-Suarez]
4240841
+
4240841
+ - INCLUDE_COMMAND portability fixes for VMS (RT#58181) [Craig Berry]
4240841
+
4240841
+ - INCLUDE_COMMAND fixes to detect non-zero exit codes (RT#52873)
4240841
+   [Steffen Mueller]
4240841
+
4240841
+2.2205 - Wed Mar 10 18:15:36 EST 2010
4240841
+
4240841
+ Other:
4240841
+
4240841
+ - No longer ships with Build.PL to avoid creating a circular dependency
4240841
+
4240841
+2.2204 - Wed Mar 10 14:23:52 EST 2010
4240841
+
4240841
+ Other:
4240841
+
4240841
+ - Downgraded warnings on using INCLUDE with a command from "deprecated"
4240841
+   to "discouraged" and limited it to the case where the command includes
4240841
+   "perl" [Steffen Mueller]
4240841
+
4240841
+2.2203 - Thu Feb 11 14:00:51 EST 2010
4240841
+
4240841
+ Bug fixes:
4240841
+
4240841
+ - Build.PL was not including ExtUtils/xsubpp for installation.  Fixed
4240841
+   by subclassing M::B::find_pm_files to include it [David Golden]
4240841
+
4240841
+2.2202 - Wed Jan 27 15:04:59 EST 2010
4240841
+
4240841
+ Bug fixes:
4240841
+
4240841
+ - The fix to IN/OUT/OUTLIST was itself broken and is now fixed.
4240841
+   [Reported by Serdar Dalgic; fix suggested by Rafael Garcia-Suarez]
4240841
+
4240841
+   We apologize for the fault in the regex. Those responsible 
4240841
+   have been sacked.
4240841
+
4240841
+2.2201 Mon Jan 25 16:12:05 EST 2010
4240841
+
4240841
+ Bug fixes:
4240841
+
4240841
+ - IN/OUT/OUTLIST, etc. were broken due to a bad regexp.  [Simon Cozens]
4240841
+
4240841
+2.22 - Mon Jan 11 15:00:07 EST 2010
4240841
+
4240841
+ No changes from 2.21_02
4240841
+
4240841
+2.21_02 - Sat Dec 19 10:55:41 EST 2009
4240841
+
4240841
+ Bug fixes:
4240841
+
4240841
+ - fixed bugs and added tests for INCLUDE_COMMAND [Steffen Mueller]
4240841
+
4240841
+2.21_01 - Sat Dec 19 07:22:44 EST 2009
4240841
+
4240841
+ Enhancements:
4240841
+
4240841
+ - New 'INCLUDE_COMMAND' directive [Steffen Mueller]
4240841
+
4240841
+ Bug fixes:
4240841
+
4240841
+ - Workaround for empty newXS macro found in P5NCI [Goro Fuji]
4240841
+
4240841
 2.21 - Mon Oct  5 11:17:53 EDT 2009
4240841
 
4240841
  Bug fixes:
4240841
@@ -12,7 +80,7 @@ Revision history for Perl extension ExtU
4240841
 
4240841
  Bug fixes:
4240841
  - Use "char* file" for perl < 5.9, not "char[] file"; fixes mod_perl
4240841
-   breakage due to prior attempts to fix RT#48104 [David Golden] 
4240841
+   breakage due to prior attempts to fix RT#48104 [David Golden]
4240841
 
4240841
 2.20_06 - Fri Oct  2 23:45:45 EDT 2009
4240841
 
4240841
@@ -62,8 +130,8 @@ Revision history for Perl extension ExtU
4240841
 2.20_03 - Thu Jul 23 23:14:50 EDT 2009
4240841
 
4240841
  Bug fixes:
4240841
- - Fixed "const char *" errors for 5.8.8 (and older) (RT#48104) 
4240841
-   [Vincent Pit] 
4240841
+ - Fixed "const char *" errors for 5.8.8 (and older) (RT#48104)
4240841
+   [Vincent Pit]
4240841
  - Added newline before a preprocessor directive (RT#30673)
4240841
    [patch by hjp]
4240841
 
4240841
diff -up perl-5.12.3/cpan/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm.22206 perl-5.12.3/cpan/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm
4240841
--- perl-5.12.3/cpan/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm.22206	2011-01-09 15:20:53.000000000 -0500
4240841
+++ perl-5.12.3/cpan/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm	2011-01-26 16:16:15.366548997 -0500
4240841
@@ -18,7 +18,7 @@ my(@XSStack);	# Stack of conditionals an
4240841
 my($XSS_work_idx, $cpp_next_tmp);
4240841
 
4240841
 use vars qw($VERSION);
4240841
-$VERSION = '2.21';
4240841
+$VERSION = '2.2206';
4240841
 $VERSION = eval $VERSION if $VERSION =~ /_/;
4240841
 
4240841
 use vars qw(%input_expr %output_expr $ProtoUsed @InitFileCode $FH $proto_re $Overload $errors $Fallback
4240841
@@ -74,7 +74,7 @@ sub process_file {
4240841
   ($XSS_work_idx, $cpp_next_tmp) = (0, "XSubPPtmpAAAA");
4240841
   @InitFileCode = ();
4240841
   $FH = Symbol::gensym();
4240841
-  $proto_re = "[" . quotemeta('\$%&*;;[]') . "]" ;
4240841
+  $proto_re = "[" . quotemeta('\$%&*;;[]_') . "]" ;
4240841
   $Overload = 0;
4240841
   $errors = 0;
4240841
   $Fallback = '&PL_sv_undef';
4240841
@@ -230,9 +230,10 @@ sub process_file {
4240841
 
4240841
   # Match an XS keyword
4240841
   $BLOCK_re= '\s*(' . join('|', qw(
4240841
-				   REQUIRE BOOT CASE PREINIT INPUT INIT CODE PPCODE OUTPUT
4240841
-				   CLEANUP ALIAS ATTRS PROTOTYPES PROTOTYPE VERSIONCHECK INCLUDE
4240841
-				   SCOPE INTERFACE INTERFACE_MACRO C_ARGS POSTCALL OVERLOAD FALLBACK
4240841
+				   REQUIRE BOOT CASE PREINIT INPUT INIT CODE PPCODE
4240841
+				   OUTPUT CLEANUP ALIAS ATTRS PROTOTYPES PROTOTYPE
4240841
+				   VERSIONCHECK INCLUDE INCLUDE_COMMAND SCOPE INTERFACE
4240841
+				   INTERFACE_MACRO C_ARGS POSTCALL OVERLOAD FALLBACK
4240841
 				  )) . "|$END)\\s*:";
4240841
 
4240841
   
4240841
@@ -448,7 +449,7 @@ EOF
4240841
     $xsreturn = 0;
4240841
 
4240841
     $_ = shift(@line);
4240841
-    while (my $kwd = check_keyword("REQUIRE|PROTOTYPES|FALLBACK|VERSIONCHECK|INCLUDE|SCOPE")) {
4240841
+    while (my $kwd = check_keyword("REQUIRE|PROTOTYPES|FALLBACK|VERSIONCHECK|INCLUDE(?:_COMMAND)?|SCOPE")) {
4240841
       &{"${kwd}_handler"}() ;
4240841
       next PARAGRAPH unless @line ;
4240841
       $_ = shift(@line);
4240841
@@ -520,11 +521,11 @@ EOF
4240841
 	  next unless defined($pre) && length($pre);
4240841
 	  my $out_type = '';
4240841
 	  my $inout_var;
4240841
-	  if ($process_inout and s/^(IN|IN_OUTLIST|OUTLIST|OUT|IN_OUT)\s+//) {
4240841
+	  if ($process_inout and s/^(IN|IN_OUTLIST|OUTLIST|OUT|IN_OUT)\b\s*//) {
4240841
 	    my $type = $1;
4240841
 	    $out_type = $type if $type ne 'IN';
4240841
-	    $arg =~ s/^(IN|IN_OUTLIST|OUTLIST|OUT|IN_OUT)\s+//;
4240841
-	    $pre =~ s/^(IN|IN_OUTLIST|OUTLIST|OUT|IN_OUT)\s+//;
4240841
+	    $arg =~ s/^(IN|IN_OUTLIST|OUTLIST|OUT|IN_OUT)\b\s*//;
4240841
+	    $pre =~ s/^(IN|IN_OUTLIST|OUTLIST|OUT|IN_OUT)\b\s*//;
4240841
 	  }
4240841
 	  my $islength;
4240841
 	  if ($name =~ /^length\( \s* (\w+) \s* \)\z/x) {
4240841
@@ -554,7 +555,7 @@ EOF
4240841
     } else {
4240841
       @args = split(/\s*,\s*/, $orig_args);
4240841
       for (@args) {
4240841
-	if ($process_inout and s/^(IN|IN_OUTLIST|OUTLIST|IN_OUT|OUT)\s+//) {
4240841
+	if ($process_inout and s/^(IN|IN_OUTLIST|OUTLIST|IN_OUT|OUT)\b\s*//) {
4240841
 	  my $out_type = $1;
4240841
 	  next if $out_type eq 'IN';
4240841
 	  $only_C_inlist{$_} = 1 if $out_type eq "OUTLIST";
4240841
@@ -934,6 +935,10 @@ EOF
4240841
 EOF
4240841
       }
4240841
     }
4240841
+    elsif($newXS eq 'newXS'){ # work around P5NCI's empty newXS macro
4240841
+      push(@InitFileCode,
4240841
+	   "        ${newXS}(\"$pname\", XS_$Full_func_name, file$proto);\n");
4240841
+    }
4240841
     else {
4240841
       push(@InitFileCode,
4240841
 	   "        (void)${newXS}(\"$pname\", XS_$Full_func_name, file$proto);\n");
4240841
@@ -1481,6 +1486,25 @@ sub PROTOTYPES_handler ()
4240841
 
4240841
   }
4240841
 
4240841
+sub PushXSStack
4240841
+  {
4240841
+    my %args = @_;
4240841
+    # Save the current file context.
4240841
+    push(@XSStack, {
4240841
+		    type            => 'file',
4240841
+		    LastLine        => $lastline,
4240841
+		    LastLineNo      => $lastline_no,
4240841
+		    Line            => \@line,
4240841
+		    LineNo          => \@line_no,
4240841
+		    Filename        => $filename,
4240841
+		    Filepathname    => $filepathname,
4240841
+		    Handle          => $FH,
4240841
+                    IsPipe          => scalar($filename =~ /\|\s*$/),
4240841
+                    %args,
4240841
+		   }) ;
4240841
+
4240841
+  }
4240841
+
4240841
 sub INCLUDE_handler ()
4240841
   {
4240841
     # the rest of the current line should contain a valid filename
4240841
@@ -1499,17 +1523,16 @@ sub INCLUDE_handler ()
4240841
 
4240841
     ++ $IncludedFiles{$_} unless /\|\s*$/ ;
4240841
 
4240841
-    # Save the current file context.
4240841
-    push(@XSStack, {
4240841
-		    type		=> 'file',
4240841
-		    LastLine        => $lastline,
4240841
-		    LastLineNo      => $lastline_no,
4240841
-		    Line            => \@line,
4240841
-		    LineNo          => \@line_no,
4240841
-		    Filename        => $filename,
4240841
-		    Filepathname    => $filepathname,
4240841
-		    Handle          => $FH,
4240841
-		   }) ;
4240841
+    if (/\|\s*$/ && /^\s*perl\s/) {
4240841
+      Warn("The INCLUDE directive with a command is discouraged." .
4240841
+           " Use INCLUDE_COMMAND instead! In particular using 'perl'" .
4240841
+           " in an 'INCLUDE: ... |' directive is not guaranteed to pick" .
4240841
+           " up the correct perl. The INCLUDE_COMMAND directive allows" .
4240841
+           " the use of \$^X as the currently running perl, see" .
4240841
+           " 'perldoc perlxs' for details.");
4240841
+    }
4240841
+
4240841
+    PushXSStack();
4240841
 
4240841
     $FH = Symbol::gensym();
4240841
 
4240841
@@ -1523,7 +1546,7 @@ sub INCLUDE_handler ()
4240841
 EOF
4240841
 
4240841
     $filename = $_ ;
4240841
-    $filepathname = "$dir/$filename";
4240841
+    $filepathname = File::Spec->catfile($dir, $filename);
4240841
 
4240841
     # Prime the pump by reading the first
4240841
     # non-blank line
4240841
@@ -1535,7 +1558,64 @@ EOF
4240841
 
4240841
     $lastline = $_ ;
4240841
     $lastline_no = $. ;
4240841
+  }
4240841
+
4240841
+sub QuoteArgs {
4240841
+    my $cmd = shift;
4240841
+    my @args = split /\s+/, $cmd;
4240841
+    $cmd = shift @args;
4240841
+    for (@args) {
4240841
+       $_ = q(").$_.q(") if !/^\"/ && length($_) > 0;
4240841
+    }
4240841
+    return join (' ', ($cmd, @args));
4240841
+  }
4240841
 
4240841
+sub INCLUDE_COMMAND_handler ()
4240841
+  {
4240841
+    # the rest of the current line should contain a valid command
4240841
+
4240841
+    TrimWhitespace($_) ;
4240841
+
4240841
+    $_ = QuoteArgs($_) if $^O eq 'VMS';
4240841
+
4240841
+    death("INCLUDE_COMMAND: command missing")
4240841
+      unless $_ ;
4240841
+
4240841
+    death("INCLUDE_COMMAND: pipes are illegal")
4240841
+      if /^\s*\|/ or /\|\s*$/ ;
4240841
+
4240841
+    PushXSStack( IsPipe => 1 );
4240841
+
4240841
+    $FH = Symbol::gensym();
4240841
+
4240841
+    # If $^X is used in INCLUDE_COMMAND, we know it's supposed to be
4240841
+    # the same perl interpreter as we're currently running
4240841
+    s/^\s*\$\^X/$^X/;
4240841
+
4240841
+    # open the new file
4240841
+    open ($FH, "-|", "$_")
4240841
+      or death("Cannot run command '$_' to include its output: $!") ;
4240841
+
4240841
+    print Q(<<"EOF");
4240841
+#
4240841
+#/* INCLUDE_COMMAND:  Including output of '$_' from '$filename' */
4240841
+#
4240841
+EOF
4240841
+
4240841
+    $filename = $_ ;
4240841
+    $filepathname = $filename;
4240841
+    $filepathname =~ s/\"/\\"/g;
4240841
+
4240841
+    # Prime the pump by reading the first
4240841
+    # non-blank line
4240841
+
4240841
+    # skip leading blank lines
4240841
+    while (<$FH>) {
4240841
+      last unless /^\s*$/ ;
4240841
+    }
4240841
+
4240841
+    $lastline = $_ ;
4240841
+    $lastline_no = $. ;
4240841
   }
4240841
 
4240841
 sub PopFile()
4240841
@@ -1544,7 +1624,7 @@ sub PopFile()
4240841
 
4240841
     my $data     = pop @XSStack ;
4240841
     my $ThisFile = $filename ;
4240841
-    my $isPipe   = ($filename =~ /\|\s*$/) ;
4240841
+    my $isPipe   = $data->{IsPipe};
4240841
 
4240841
     -- $IncludedFiles{$filename}
4240841
       unless $isPipe ;
4240841
diff -up perl-5.12.3/cpan/ExtUtils-ParseXS/lib/ExtUtils/xsubpp.22206 perl-5.12.3/cpan/ExtUtils-ParseXS/lib/ExtUtils/xsubpp
4240841
diff -up perl-5.12.3/cpan/ExtUtils-ParseXS/t/more.t.22206 perl-5.12.3/cpan/ExtUtils-ParseXS/t/more.t
4240841
--- perl-5.12.3/cpan/ExtUtils-ParseXS/t/more.t.22206	2011-01-09 15:20:53.000000000 -0500
4240841
+++ perl-5.12.3/cpan/ExtUtils-ParseXS/t/more.t	2011-01-26 16:17:03.000549001 -0500
4240841
@@ -8,7 +8,7 @@ use ExtUtils::CBuilder;
4240841
 use attributes;
4240841
 use overload;
4240841
 
4240841
-plan tests => 24;
4240841
+plan tests => 25;
4240841
 
4240841
 my ($source_file, $obj_file, $lib_file);
4240841
 
4240841
@@ -42,7 +42,7 @@ SKIP: {
4240841
 }
4240841
 
4240841
 SKIP: {
4240841
-  skip "no dynamic loading", 5
4240841
+  skip "no dynamic loading", 6
4240841
     if !$b->have_compiler || !$Config{usedl};
4240841
   my $module = 'XSMore';
4240841
   $lib_file = $b->link( objects => $obj_file, module_name => $module );
4240841
@@ -88,6 +88,8 @@ SKIP: {
4240841
 
4240841
   is XSMore::len("foo"), 3, 'the length keyword';
4240841
 
4240841
+  is XSMore::sum(5, 9), 14, 'the INCLUDE_COMMAND directive';
4240841
+
4240841
   # Win32 needs to close the DLL before it can unlink it, but unfortunately
4240841
   # dl_unload_file was missing on Win32 prior to perl change #24679!
4240841
   if ($^O eq 'MSWin32' and defined &DynaLoader::dl_unload_file) {
4240841
diff -up perl-5.12.3/cpan/ExtUtils-ParseXS/t/XSMore.xs.22206 perl-5.12.3/cpan/ExtUtils-ParseXS/t/XSMore.xs
4240841
--- perl-5.12.3/cpan/ExtUtils-ParseXS/t/XSMore.xs.22206	2011-01-09 15:20:53.000000000 -0500
4240841
+++ perl-5.12.3/cpan/ExtUtils-ParseXS/t/XSMore.xs	2011-01-26 16:17:22.844549001 -0500
4240841
@@ -106,6 +106,8 @@ outlist(OUTLIST int a, OUTLIST int b)
4240841
 int
4240841
 len(char* s, int length(s))
4240841
 
4240841
+INCLUDE_COMMAND: $^X -Ilib -It/lib -MIncludeTester -e IncludeTester::print_xs
4240841
+
4240841
 #if 1
4240841
 
4240841
 INCLUDE: XSInclude.xsh
7026062
diff -up perl-5.12.3/cpan/ExtUtils-ParseXS/t/lib/IncludeTester.pm.22206 perl-5.12.3/cpan/ExtUtils-ParseXS/t/lib/IncludeTester.pm
7026062
--- perl-5.12.3/cpan/ExtUtils-ParseXS/t/lib/IncludeTester.pm.22206	2011-01-26 16:38:04.432549002 -0500
7026062
+++ perl-5.12.3/cpan/ExtUtils-ParseXS/t/lib/IncludeTester.pm	2011-01-26 16:37:49.862549001 -0500
7026062
@@ -0,0 +1,20 @@
7026062
+package IncludeTester;
7026062
+use strict;
7026062
+
7026062
+sub print_xs {
7026062
+  print <<'HERE';
7026062
+
7026062
+int
7026062
+sum(a, b)
7026062
+    int a
7026062
+    int b
7026062
+  CODE:
7026062
+    RETVAL = a + b;
7026062
+  OUTPUT:
7026062
+    RETVAL
7026062
+
7026062
+HERE
7026062
+}
7026062
+
7026062
+1;
7026062
+
7026062
diff -up perl-5.12.3/MANIFEST.22206 perl-5.12.3/MANIFEST
7026062
--- perl-5.12.3/MANIFEST.22206	2011-01-26 16:36:42.933549001 -0500
16e956a
+++ perl-5.12.3/MANIFEST	2011-01-26 16:50:52.762549003 -0500
16e956a
@@ -1044,6 +1044,7 @@ cpan/ExtUtils-ParseXS/Changes			ExtUtils
16e956a
 cpan/ExtUtils-ParseXS/lib/ExtUtils/ParseXS.pm	converts Perl XS code into C code
16e956a
 cpan/ExtUtils-ParseXS/lib/ExtUtils/xsubpp	External subroutine preprocessor
16e956a
 cpan/ExtUtils-ParseXS/t/basic.t			See if ExtUtils::ParseXS works
7026062
+cpan/ExtUtils-ParseXS/t/lib/IncludeTester.pm
16e956a
 cpan/ExtUtils-ParseXS/t/more.t			Extended ExtUtils::ParseXS testing
16e956a
 cpan/ExtUtils-ParseXS/t/typemap			Standard typemap for controlled testing
16e956a
 cpan/ExtUtils-ParseXS/t/usage.t			ExtUtils::ParseXS tests