This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
move Carp to ext/Carp, preparing for dual-lifing
authorZefram <zefram@fysh.org>
Wed, 31 Aug 2011 19:59:01 +0000 (20:59 +0100)
committerZefram <zefram@fysh.org>
Sun, 4 Sep 2011 14:27:34 +0000 (15:27 +0100)
MANIFEST
Makefile.SH
Porting/Maintainers.pl
ext/Carp/Makefile.PL [new file with mode: 0644]
ext/Carp/lib/Carp.pm [moved from lib/Carp.pm with 100% similarity]
ext/Carp/lib/Carp/Heavy.pm [moved from lib/Carp/Heavy.pm with 100% similarity]
ext/Carp/t/Carp.t [moved from lib/Carp.t with 92% similarity]
lib/.gitignore
write_buildcustomize.pl

index 6e882a0..81a5702 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -3464,6 +3464,10 @@ ext/B/t/terse.t          See if B::Terse works
 ext/B/t/walkoptree.t   See if B::walkoptree (and friends) work
 ext/B/t/xref.t         See if B::Xref works
 ext/B/typemap                  Compiler backend interface types
+ext/Carp/lib/Carp/Heavy.pm     Error message retired workhorse
+ext/Carp/lib/Carp.pm           Error message extension
+ext/Carp/Makefile.PL           makefile writer for Carp
+ext/Carp/t/Carp.t              See if Carp works
 ext/Devel-Peek/Changes         Data debugging tool, changelog
 ext/Devel-Peek/Makefile.PL     Data debugging tool, makefile writer
 ext/Devel-Peek/Peek.pm         Data debugging tool, module and pod
@@ -3949,9 +3953,6 @@ lib/blib.t                        blib.pm test
 lib/bytes_heavy.pl             Support routines for byte pragma
 lib/bytes.pm                   Pragma to enable byte operations
 lib/bytes.t                    bytes.pm test
-lib/Carp/Heavy.pm              Error message workhorse
-lib/Carp.pm                    Error message base class
-lib/Carp.t                     See if Carp works
 lib/charnames.pm               Character names
 lib/charnames.t                        See if character names work
 lib/Class/Struct.pm            Declare struct-like datatypes as Perl classes
index 3119f61..6b824f5 100755 (executable)
@@ -1296,7 +1296,7 @@ _cleaner2:
        -rmdir cpan/CPANPLUS-Dist-Build/t/dummy-cpanplus cpan/CPANPLUS/t/dummy-cpanplus cpan/CPANPLUS/t/dummy-localmirror
        -rmdir ext/B/lib
        -rmdir lib/Archive/Tar lib/Archive lib/Attribute
-       -rmdir lib/CGI
+       -rmdir lib/CGI lib/Carp
        -rmdir lib/Data lib/Devel lib/Digest
        -rmdir lib/ExtUtils/Command lib/ExtUtils/Constant lib/ExtUtils/Liblist lib/ExtUtils/MakeMaker
        -rmdir lib/File/Spec lib/Filter/Util lib/Filter
index bdd061e..8ad5471 100755 (executable)
@@ -343,7 +343,7 @@ use File::Glob qw(:case);
     'Carp' =>
        {
        'MAINTAINER'    => 'p5p',
-       'FILES'         => q[lib/Carp.{pm,t} lib/Carp/Heavy.pm],
+       'FILES'         => q[ext/Carp],
        'UPSTREAM'      => 'blead',
        },
 
diff --git a/ext/Carp/Makefile.PL b/ext/Carp/Makefile.PL
new file mode 100644 (file)
index 0000000..313f537
--- /dev/null
@@ -0,0 +1,21 @@
+use warnings;
+use strict;
+
+use ExtUtils::MakeMaker;
+
+WriteMakefile(
+       NAME => "Carp",
+       VERSION_FROM => "lib/Carp.pm",
+       ABSTRACT_FROM => "lib/Carp.pm",
+       PREREQ_PM => {
+               "Exporter" => 0,
+               "IPC::Open3" => "1.0104",
+               "Test::More" => 0,
+               "strict" => 0,
+               "warnings" => 0,
+       },
+       LICENSE => "perl",
+       INSTALLDIRS => "$]" < 5.011 ? "perl" : "site",
+);
+
+1;
similarity index 100%
rename from lib/Carp.pm
rename to ext/Carp/lib/Carp.pm
similarity index 100%
rename from lib/Carp/Heavy.pm
rename to ext/Carp/lib/Carp/Heavy.pm
similarity index 92%
rename from lib/Carp.t
rename to ext/Carp/t/Carp.t
index 253baac..60b3305 100644 (file)
@@ -1,20 +1,26 @@
-BEGIN {
-    chdir 't' if -d 't';
-    @INC = '../lib';
-    require './test.pl';
-}
-
 use warnings;
 no warnings "once";
 use Config;
 
+use IPC::Open3 1.0104 qw(open3);
+use Test::More tests => 58;
+
+sub runperl {
+    my(%args) = @_;
+    my($w, $r);
+    my $pid = open3($w, $r, undef, $^X, "-e", $args{prog});
+    close $w;
+    my $output = "";
+    while(<$r>) { $output .= $_; }
+    waitpid($pid, 0);
+    return $output;
+}
+
 my $Is_VMS = $^O eq 'VMS';
 
 use Carp qw(carp cluck croak confess);
 
 BEGIN {
-    plan tests => 58;
-
     # This test must be run at BEGIN time, because code later in this file
     # sets CORE::GLOBAL::caller
     ok !exists $CORE::GLOBAL::{caller},
@@ -380,34 +386,36 @@ like(
 
 # UTF8-flagged strings should not cause Carp to try to load modules (even
 # implicitly via utf8_heavy.pl) after a syntax error [perl #82854].
-fresh_perl_like(
- q<
-   use utf8; use strict; use Carp;
-   BEGIN { $SIG{__DIE__} = sub { Carp::croak "aaaaa$_[0]" } }
-   $c
-  >,
- qr/aaaaa/,
- {stderr=>1},
- 'Carp can handle UTF8-flagged strings after a syntax error',
+like(
+  runperl(
+    prog => q<
+      use utf8; use strict; use Carp;
+      BEGIN { $SIG{__DIE__} = sub { Carp::croak "aaaaa$_[0]" } }
+      $c
+    >,
+    stderr=>1,
+  ),
+  qr/aaaaa/,
+  'Carp can handle UTF8-flagged strings after a syntax error',
 );
 
 SKIP:
 {
     skip("B:: always created when static", 1)
       if $Config{static_ext} =~ /\bB\b/;
-
-    fresh_perl_is(
-     q<
-       use Carp;
-       $SIG{__WARN__} = sub{};
-       carp ("A duck, but which duck?");
-       print "ok" unless exists $::{"B::"};
-      >,
-     'ok',
-     {},
-     'Carp does not autovivify *B::'
+    is(
+      runperl(
+       prog => q<
+         use Carp;
+         $SIG{__WARN__} = sub{};
+         carp ("A duck, but which duck?");
+         print "ok" unless exists $::{"B::"};
+       >,
+      ),
+      'ok',
+      'Carp does not autovivify *B::',
     );
-  }
+}
 
 # New tests go here
 
index 67151e3..5998e45 100644 (file)
 /CPANPLUS/Shell/Default/Plugins/HOWTO.pod
 /CPANPLUS/Shell/Default/Plugins/Remote.pm
 /CPANPLUS/Shell/Default/Plugins/Source.pm
+/Carp.pm
+/Carp/Heavy.pm
 /Class/ISA.pm
 /Compress
 /Config.pm
index 0508e27..24c767c 100644 (file)
@@ -18,6 +18,7 @@ require File::Spec::Functions;
 # allow miniperl to build everything else.
 
 my @toolchain = qw(cpan/AutoLoader/lib
+                  ext/Carp/lib
                   dist/Cwd dist/Cwd/lib
                   dist/ExtUtils-Command/lib
                   dist/ExtUtils-Install/lib