Change 14325 by jhi@alpha on 2002/01/18 14:30:49

        Subject: [PATCH] Syncing with bleadperl 
        From: Michael G Schwern <[EMAIL PROTECTED]> 
        Date: Fri, 18 Jan 2002 03:04:33 -0500
        Message-ID: <20020118080432.GC7226@blackrider>

Affected files ...

.... //depot/perl/MANIFEST#716 edit
.... //depot/perl/lib/ExtUtils/Changes#1 add
.... //depot/perl/lib/ExtUtils/Embed.pm#23 edit
.... //depot/perl/lib/ExtUtils/Liblist.pm#33 edit
.... //depot/perl/lib/ExtUtils/MM_Win32.pm#35 edit
.... //depot/perl/lib/ExtUtils/MakeMaker.pm#80 edit
.... //depot/perl/lib/ExtUtils/Manifest.pm#28 edit
.... //depot/perl/lib/ExtUtils/Mkbootstrap.pm#9 edit
.... //depot/perl/lib/ExtUtils/Mksymlists.pm#29 edit
.... //depot/perl/lib/ExtUtils/inst#2 delete
.... //depot/perl/lib/ExtUtils/instmodsh#1 add
.... //depot/perl/lib/ExtUtils/t/Command.t#3 edit
.... //depot/perl/lib/ExtUtils/t/Embed.t#5 edit
.... //depot/perl/lib/ExtUtils/t/ExtUtils.t#2 edit
.... //depot/perl/lib/ExtUtils/t/Installed.t#3 edit
.... //depot/perl/lib/ExtUtils/t/MM_BeOS.t#2 edit
.... //depot/perl/lib/ExtUtils/t/MM_Cygwin.t#3 edit
.... //depot/perl/lib/ExtUtils/t/MM_OS2.t#3 edit
.... //depot/perl/lib/ExtUtils/t/MM_Unix.t#8 edit
.... //depot/perl/lib/ExtUtils/t/MM_VMS.t#2 edit
.... //depot/perl/lib/ExtUtils/t/MM_Win32.t#5 edit
.... //depot/perl/lib/ExtUtils/t/Manifest.t#3 edit
.... //depot/perl/lib/ExtUtils/t/Mkbootstrap.t#3 edit
.... //depot/perl/lib/ExtUtils/t/Packlist.t#2 edit
.... //depot/perl/lib/ExtUtils/t/hints.t#2 edit
.... //depot/perl/lib/ExtUtils/t/testlib.t#2 edit
.... //depot/perl/lib/ExtUtils/testlib.pm#7 edit
.... //depot/perl/t/lib/TieOut.pm#1 add

Differences ...

==== //depot/perl/MANIFEST#716 (text) ====
Index: perl/MANIFEST
--- perl/MANIFEST.~1~   Fri Jan 18 07:45:05 2002
+++ perl/MANIFEST       Fri Jan 18 07:45:05 2002
@@ -931,10 +931,11 @@
 lib/Exporter.pm                        Exporter base class
 lib/Exporter.t                 See if Exporter works
 lib/Exporter/Heavy.pm          Complicated routines for Exporter
+lib/ExtUtils/Changes            MakeMaker change log
 lib/ExtUtils/Command.pm                Utilities for Make on non-UNIX platforms
 lib/ExtUtils/Constant.pm       generate XS code to import C header constants
 lib/ExtUtils/Embed.pm          Utilities for embedding Perl in C programs
-lib/ExtUtils/inst              Give information about installed extensions
+lib/ExtUtils/instmodsh         Give information about installed extensions
 lib/ExtUtils/Install.pm                Handles 'make install' on extensions
 lib/ExtUtils/Installed.pm      Information on installed extensions
 lib/ExtUtils/Liblist.pm                Locates libraries
@@ -2154,6 +2155,7 @@
 t/lib/Test/Simple/sample_tests/success.plx              for exit.t
 t/lib/Test/Simple/sample_tests/too_few.plx              for exit.t
 t/lib/Test/Simple/sample_tests/two_fail.plx             for exit.t
+t/lib/TieOut.pm                 Testing library to capture prints
 t/lib/warnings/1global         Tests of global warnings for warnings.t
 t/lib/warnings/2use            Tests for "use warnings" for warnings.t
 t/lib/warnings/3both           Tests for interaction of $^W and "use warnings"

==== //depot/perl/lib/ExtUtils/Embed.pm#23 (text) ====
Index: perl/lib/ExtUtils/Embed.pm
--- perl/lib/ExtUtils/Embed.pm.~1~      Fri Jan 18 07:45:05 2002
+++ perl/lib/ExtUtils/Embed.pm  Fri Jan 18 07:45:05 2002
@@ -1,4 +1,4 @@
-# $Id: Embed.pm,v 1.2501 $
+# $Id: Embed.pm,v 1.1.1.1 2002/01/16 19:27:19 schwern Exp $
 require 5.002;
 
 package ExtUtils::Embed;
@@ -18,7 +18,7 @@
            );
 use strict;
 
-$VERSION = sprintf("%d.%02d", q$Revision: 1.2506_00 $ =~ /(\d+)\.(\d+)/);
+$VERSION = 1.2506_01;
 
 @ISA = qw(Exporter);
 @EXPORT = qw(&xsinit &ldopts 

==== //depot/perl/lib/ExtUtils/Liblist.pm#33 (text) ====
Index: perl/lib/ExtUtils/Liblist.pm
--- perl/lib/ExtUtils/Liblist.pm.~1~    Fri Jan 18 07:45:05 2002
+++ perl/lib/ExtUtils/Liblist.pm        Fri Jan 18 07:45:05 2002
@@ -24,7 +24,7 @@
 use 5.006_001;
 # Broken out of MakeMaker from version 4.11
 
-our $VERSION = substr q$Revision: 1.27 $, 10;
+our $VERSION = 1.27_01;
 
 use Config;
 use Cwd 'cwd';

==== //depot/perl/lib/ExtUtils/MM_Win32.pm#35 (text) ====
Index: perl/lib/ExtUtils/MM_Win32.pm
--- perl/lib/ExtUtils/MM_Win32.pm.~1~   Fri Jan 18 07:45:05 2002
+++ perl/lib/ExtUtils/MM_Win32.pm       Fri Jan 18 07:45:05 2002
@@ -1,6 +1,6 @@
 package ExtUtils::MM_Win32;
 
-our $VERSION = '1.00';
+our $VERSION = '1.00_02';
 
 =head1 NAME
 
@@ -144,6 +144,8 @@
 
 sub find_perl {
     my($self, $ver, $names, $dirs, $trace) = @_;
+    $trace ||= 0;
+
     my($name, $dir);
     if ($trace >= 2){
        print "Looking for perl $ver by these names:
@@ -263,7 +265,7 @@
 };
 
     push @m, qq{
-MAKEMAKER = $INC{'ExtUtils\MakeMaker.pm'}
+MAKEMAKER = $INC{'ExtUtils/MakeMaker.pm'}
 MM_VERSION = $ExtUtils::MakeMaker::VERSION
 };
 
@@ -322,10 +324,10 @@
 
 .SUFFIXES: .xs .c .C .cpp .cxx .cc \$(OBJ_EXT)
 
-# Nick wanted to get rid of .PRECIOUS. I don't remember why. I seem to recall, that
-# some make implementations will delete the Makefile when we rebuild it. Because
-# we call false(1) when we rebuild it. So make(1) is not completely wrong when it
-# does so. Our milage may vary.
+# Nick wanted to get rid of .PRECIOUS. I don't remember why. I seem to 
+# recall, that some make implementations will delete the Makefile when we 
+# rebuild it. Because we call false(1) when we rebuild it. So make(1) is 
+# not completely wrong when it does so. Our milage may vary.
 # .PRECIOUS: Makefile    # seems to be not necessary anymore
 
 .PHONY: all config static dynamic test linkext manifest

==== //depot/perl/lib/ExtUtils/MakeMaker.pm#80 (text) ====
Index: perl/lib/ExtUtils/MakeMaker.pm
--- perl/lib/ExtUtils/MakeMaker.pm.~1~  Fri Jan 18 07:45:05 2002
+++ perl/lib/ExtUtils/MakeMaker.pm      Fri Jan 18 07:45:05 2002
@@ -2,10 +2,10 @@
 
 package ExtUtils::MakeMaker;
 
-$VERSION = "5.48";
+$VERSION = "5.48_03";
 $Version_OK = "5.17";  # Makefiles older than $Version_OK will die
                        # (Will be checked from MakeMaker version 4.13 onwards)
-($Revision = substr(q$Revision: 1.222 $, 10)) =~ s/\s+$//;
+($Revision = substr(q$Revision: 1.4 $, 10)) =~ s/\s+$//;
 
 
 
@@ -349,7 +349,7 @@
            warn "Warning: prerequisite $prereq $self->{PREREQ_PM}->{$prereq} not 
found.\n" unless $self->{PREREQ_FATAL};
            $unsatisfied{$prereq} = 'not installed';
        } elsif ($prereq->VERSION < $self->{PREREQ_PM}->{$prereq} ){
-           warn "Warning: prerequisite $prereq $self->{PREREQ_PM}->{$prereq} not 
found. We have"
+           warn "Warning: prerequisite $prereq $self->{PREREQ_PM}->{$prereq} not 
+found. We have "
                . ($prereq->VERSION || 'unknown version') unless $self->{PREREQ_FATAL};
            $unsatisfied{$prereq} = $self->{PREREQ_PM}->{$prereq} ? 
$self->{PREREQ_PM}->{$prereq} : 'unknown version' ;
        }
@@ -681,14 +681,14 @@
     return unless -f $hint_file;    # really there
 
     # execute the hintsfile:
-    print STDOUT "Processing hints file $hint_file\n";
+    print STDERR "Processing hints file $hint_file\n";
     {
         local *HINT;
         open(HINT, $hint_file) || die "Can't open $hint_file: $!";
         eval join '', <HINT>;
         close HINT;
     }
-    print STDOUT $@ if $@;
+    print STDERR $@ if $@;
 }
 
 sub mv_all_methods {
@@ -1857,7 +1857,7 @@
 
     $VERSION = '1.00';
     *VERSION = \'1.01';
-    ( $VERSION ) = '$Revision: 1.222 $ ' =~ /\$Revision:\s+([^\s]+)/;
+    ( $VERSION ) = '$Revision: 1.4 $ ' =~ /\$Revision:\s+([^\s]+)/;
     $FOO::VERSION = '1.10';
     *FOO::VERSION = \'1.11';
     our $VERSION = 1.2.3;      # new for perl5.6.0 

==== //depot/perl/lib/ExtUtils/Manifest.pm#28 (text) ====
Index: perl/lib/ExtUtils/Manifest.pm
--- perl/lib/ExtUtils/Manifest.pm.~1~   Fri Jan 18 07:45:05 2002
+++ perl/lib/ExtUtils/Manifest.pm       Fri Jan 18 07:45:05 2002
@@ -12,7 +12,7 @@
            $Is_MacOS,$Is_VMS,
            $Debug,$Verbose,$Quiet,$MANIFEST,$found,$DEFAULT_MSKIP);
 
-$VERSION = substr(q$Revision: 1.35 $, 10);
+$VERSION = 1.35_00;
 @ISA=('Exporter');
 @EXPORT_OK = ('mkmanifest', 'manicheck', 'fullcheck', 'filecheck', 
              'skipcheck', 'maniread', 'manicopy');

==== //depot/perl/lib/ExtUtils/Mkbootstrap.pm#9 (text) ====
Index: perl/lib/ExtUtils/Mkbootstrap.pm
--- perl/lib/ExtUtils/Mkbootstrap.pm.~1~        Fri Jan 18 07:45:05 2002
+++ perl/lib/ExtUtils/Mkbootstrap.pm    Fri Jan 18 07:45:05 2002
@@ -1,7 +1,6 @@
 package ExtUtils::Mkbootstrap;
 
-$VERSION = substr q$Revision: 1.14 $, 10;
-# $Date: 1996/09/03 17:04:43 $
+$VERSION = 1.14_01;
 
 use Config;
 use Exporter;
@@ -75,7 +74,7 @@
 
 =head1 SYNOPSIS
 
-C<mkbootstrap>
+C<Mkbootstrap>
 
 =head1 DESCRIPTION
 

==== //depot/perl/lib/ExtUtils/Mksymlists.pm#29 (text) ====
Index: perl/lib/ExtUtils/Mksymlists.pm
--- perl/lib/ExtUtils/Mksymlists.pm.~1~ Fri Jan 18 07:45:05 2002
+++ perl/lib/ExtUtils/Mksymlists.pm     Fri Jan 18 07:45:05 2002
@@ -10,7 +10,7 @@
 our(@ISA, @EXPORT, $VERSION);
 @ISA = 'Exporter';
 @EXPORT = '&Mksymlists';
-$VERSION = substr q$Revision: 1.18 $, 10;
+$VERSION = 1.18_00;
 
 sub Mksymlists {
     my(%spec) = @_;

==== //depot/perl/lib/ExtUtils/t/Command.t#3 (text) ====
Index: perl/lib/ExtUtils/t/Command.t
--- perl/lib/ExtUtils/t/Command.t.~1~   Fri Jan 18 07:45:05 2002
+++ perl/lib/ExtUtils/t/Command.t       Fri Jan 18 07:45:05 2002
@@ -1,9 +1,15 @@
-#!./perl -Tw
+#!/usr/bin/perl -w
 
 BEGIN {
-       chdir 't' if -d 't';
-       @INC = '../lib';
+    if( $ENV{PERL_CORE} ) {
+        chdir 't';
+        @INC = ('../lib', 'lib/');
+    }
+    else {
+        unshift @INC, 't/lib/';
+    }
 }
+chdir 't';
 
 BEGIN {
        1 while unlink 'ecmdfile';
@@ -18,9 +24,8 @@
 }
 
 {
-       use vars qw( *CORE::GLOBAL::exit );
-
        # bad neighbor, but test_f() uses exit()
+    *CORE::GLOBAL::exit = '';   # quiet 'only once' warning.
        *CORE::GLOBAL::exit = sub { return @_ };
 
        use_ok( 'ExtUtils::Command' );
@@ -51,6 +56,7 @@
 
        # concatenate this file with itself
        # be extra careful the regex doesn't match itself
+    use TieOut;
        my $out = tie *STDOUT, 'TieOut';
        my $self = $0;
        unless (-f $self) {
@@ -149,13 +155,3 @@
        1 while unlink 'ecmdfile';
        File::Path::rmtree( 'ecmddir' );
 }
-
-package TieOut;
-
-sub TIEHANDLE {
-       bless( \(my $text), $_[0] );
-}
-
-sub PRINT {
-       ${ $_[0] } .= join($/, @_);
-}

==== //depot/perl/lib/ExtUtils/t/Embed.t#5 (text) ====
Index: perl/lib/ExtUtils/t/Embed.t
--- perl/lib/ExtUtils/t/Embed.t.~1~     Fri Jan 18 07:45:05 2002
+++ perl/lib/ExtUtils/t/Embed.t Fri Jan 18 07:45:05 2002
@@ -1,9 +1,13 @@
-#!./perl
+#!/usr/bin/perl
 
 BEGIN {
-    chdir 't' if -d 't';
-    unshift @INC, '../lib';
+    if( $ENV{PERL_CORE} ) {
+        chdir 't' if -d 't';
+        @INC = '../lib';
+    }
 }
+chdir 't';
+
 use Config;
 use ExtUtils::Embed;
 use File::Spec;

==== //depot/perl/lib/ExtUtils/t/ExtUtils.t#2 (text) ====
Index: perl/lib/ExtUtils/t/ExtUtils.t
--- perl/lib/ExtUtils/t/ExtUtils.t.~1~  Fri Jan 18 07:45:05 2002
+++ perl/lib/ExtUtils/t/ExtUtils.t      Fri Jan 18 07:45:05 2002
@@ -1,10 +1,12 @@
-#!./perl -w
+#!/usr/bin/perl -w
 
 print "1..27\n";
 
 BEGIN {
-    chdir 't' if -d 't';
-    @INC = '../lib';
+    if( $ENV{PERL_CORE} ) {
+        chdir 't' if -d 't';
+        @INC = '../lib';
+    }
 }
 
 # use warnings;
@@ -23,7 +25,7 @@
 $^X = $perl;
 
 print "# perl=$perl\n";
-my $runperl = "$perl -x \"-I../../lib\"";
+my $runperl = "$perl \"-I../../lib\"";
 
 $| = 1;
 
@@ -447,15 +449,32 @@
   print "not ok $test # $maketest failed: $?\n";
   print "# $_" foreach @makeout;
 } else {
-  print "ok $test\n";
+  print "ok $test - maketest\n";
 }
 $test++;
 
-my $regen = `$runperl $package.xs`;
+
+# -x is busted on Win32 < 5.6.1, so we emulate it.
+my $regen;
+if( $^O eq 'MSWin32' && $] <= 5.006001 ) {
+    open(REGENTMP, ">regentmp") or die $!;
+    open(XS, "$package.xs")     or die $!;
+    my $saw_shebang;
+    while(<XS>) {
+        $saw_shebang++ if /^#!.*/i ;
+        print REGENTMP $_ if $saw_shebang;
+    }
+    close XS;  close REGENTMP;
+    $regen = `$runperl regentmp`;
+    unlink 'regentmp';
+}
+else {
+    $regen = `$runperl -x $package.xs`;
+}
 if ($?) {
-  print "not ok $test # $runperl $package.xs failed: $?\n";
+  print "not ok $test # $runperl -x $package.xs failed: $?\n";
 } else {
-  print "ok $test\n";
+  print "ok $test - regen\n";
 }
 $test++;
 
@@ -463,9 +482,9 @@
   "\n#### XS Section:\n" . $XS_constant;
 
 if ($expect eq $regen) {
-  print "ok $test\n";
+  print "ok $test - regen worked\n";
 } else {
-  print "not ok $test\n";
+  print "not ok $test - regen worked\n";
   # open FOO, ">expect"; print FOO $expect;
   # open FOO, ">regen"; print FOO $regen; close FOO;
 }

==== //depot/perl/lib/ExtUtils/t/Installed.t#3 (text) ====
Index: perl/lib/ExtUtils/t/Installed.t
--- perl/lib/ExtUtils/t/Installed.t.~1~ Fri Jan 18 07:45:05 2002
+++ perl/lib/ExtUtils/t/Installed.t     Fri Jan 18 07:45:05 2002
@@ -1,4 +1,13 @@
-#!./perl
+#!/usr/bin/perl -w
+
+BEGIN {
+    if( $ENV{PERL_CORE} ) {
+        chdir 't' if -d 't';
+        @INC = '../lib';
+    }
+}
+chdir 't';
+
 
 use strict;
 use warnings;
@@ -13,14 +22,9 @@
 # for directories() tests
 use File::Basename;
 
-BEGIN {
-       chdir 't' if -d 't';
-       @INC = '../lib';
-}
-
 use Test::More tests => 43;
 
-use_ok( 'ExtUtils::Installed' );
+BEGIN { use_ok( 'ExtUtils::Installed' ) }
 
 # saves having to qualify package name for class methods
 my $ei = bless( {}, 'ExtUtils::Installed' );
@@ -56,7 +60,15 @@
 is( $ei->_is_under('baz', @under), 1, '... should find file under dir' );
 
 # new
-my $realei = ExtUtils::Installed->new();
+my $realei;
+{
+    # We're going to get warnings about not being able to find install
+    # directories if we're not installed.
+    local $SIG{__WARN__} = sub {
+        warn @_ unless $ENV{PERL_CORE} && $_[0] =~ /^Can't stat/;
+    };
+    $realei = ExtUtils::Installed->new();
+}
 
 isa_ok( $realei, 'ExtUtils::Installed' );
 isa_ok( $realei->{Perl}{packlist}, 'ExtUtils::Packlist' );

==== //depot/perl/lib/ExtUtils/t/MM_BeOS.t#2 (text) ====
Index: perl/lib/ExtUtils/t/MM_BeOS.t
--- perl/lib/ExtUtils/t/MM_BeOS.t.~1~   Fri Jan 18 07:45:05 2002
+++ perl/lib/ExtUtils/t/MM_BeOS.t       Fri Jan 18 07:45:05 2002
@@ -1,13 +1,12 @@
-#!perl
-
-# 2001-01-14 Tels v0.01
+#!/usr/bin/perl
 
-our $VERSION = 0.01;
-
 BEGIN {
-       chdir 't' if -d 't';
-       @INC = '../lib';
+    if( $ENV{PERL_CORE} ) {
+        chdir 't' if -d 't';
+        @INC = '../lib';
+    }
 }
+chdir 't';
 
 use Test::More;
 

==== //depot/perl/lib/ExtUtils/t/MM_Cygwin.t#3 (text) ====
Index: perl/lib/ExtUtils/t/MM_Cygwin.t
--- perl/lib/ExtUtils/t/MM_Cygwin.t.~1~ Fri Jan 18 07:45:05 2002
+++ perl/lib/ExtUtils/t/MM_Cygwin.t     Fri Jan 18 07:45:05 2002
@@ -1,9 +1,12 @@
-#!./perl
+#!/usr/bin/perl
 
 BEGIN {
-       chdir 't' if -d 't';
-       @INC = '../lib';
+    if( $ENV{PERL_CORE} ) {
+        chdir 't' if -d 't';
+        @INC = '../lib';
+    }
 }
+chdir 't';
 
 use Test::More;
 

==== //depot/perl/lib/ExtUtils/t/MM_OS2.t#3 (text) ====
Index: perl/lib/ExtUtils/t/MM_OS2.t
--- perl/lib/ExtUtils/t/MM_OS2.t.~1~    Fri Jan 18 07:45:05 2002
+++ perl/lib/ExtUtils/t/MM_OS2.t        Fri Jan 18 07:45:05 2002
@@ -1,11 +1,14 @@
-#!./perl -w
+#!/usr/bin/perl -w
 
 use strict;
 
 BEGIN {
-       chdir 't' if -d 't';
-       @INC = '../lib';
+    if( $ENV{PERL_CORE} ) {
+        chdir 't' if -d 't';
+        @INC = '../lib';
+    }
 }
+chdir 't';
 
 use Test::More;
 if ($^O =~ /os2/i) {

==== //depot/perl/lib/ExtUtils/t/MM_Unix.t#8 (text) ====
Index: perl/lib/ExtUtils/t/MM_Unix.t
--- perl/lib/ExtUtils/t/MM_Unix.t.~1~   Fri Jan 18 07:45:05 2002
+++ perl/lib/ExtUtils/t/MM_Unix.t       Fri Jan 18 07:45:05 2002
@@ -1,14 +1,12 @@
-#!./perl -w
+#!/usr/bin/perl -w
 
-# 2001-12-16 Tels first version
-# 2002-01-13 Tels 0.02 added some tests for various functions, added Andreas
-#                     fix to the version test (>= vs ==)
-# 2002-01-14 Tels 0.03 exclude on beos and netware, /i for $^O test
-
 BEGIN {
-    chdir 't' if -d 't';
-    @INC = '../lib';
+    if( $ENV{PERL_CORE} ) {
+        chdir 't' if -d 't';
+        @INC = '../lib';
+    }
 }
+chdir 't';
 
 BEGIN { 
     use Test::More; 
@@ -182,7 +180,8 @@
 ###############################################################################
 # parse_version
 
-my $self_name = '../lib/ExtUtils/t/MM_Unix.t';
+my $self_name = $ENV{PERL_CORE} ? '../lib/ExtUtils/t/MM_Unix.t' 
+                                : 'MM_Unix.t';
 
 is ($t->parse_version($self_name),'0.02',
   'parse_version on ourself');

==== //depot/perl/lib/ExtUtils/t/MM_VMS.t#2 (text) ====
Index: perl/lib/ExtUtils/t/MM_VMS.t
--- perl/lib/ExtUtils/t/MM_VMS.t.~1~    Fri Jan 18 07:45:05 2002
+++ perl/lib/ExtUtils/t/MM_VMS.t        Fri Jan 18 07:45:05 2002
@@ -1,9 +1,12 @@
-#!./perl -w
+#!/usr/bin/perl -w
 
 BEGIN {
-    chdir 't' if -d 't';
-    @INC = '../lib';
+    if( $ENV{PERL_CORE} ) {
+        chdir 't' if -d 't';
+        @INC = '../lib';
+    }
 }
+chdir 't';
 
 BEGIN {
     use Test::More;

==== //depot/perl/lib/ExtUtils/t/MM_Win32.t#5 (text) ====
Index: perl/lib/ExtUtils/t/MM_Win32.t
--- perl/lib/ExtUtils/t/MM_Win32.t.~1~  Fri Jan 18 07:45:05 2002
+++ perl/lib/ExtUtils/t/MM_Win32.t      Fri Jan 18 07:45:05 2002
@@ -1,9 +1,12 @@
-#!perl
+#!/usr/bin/perl
 
 BEGIN {
-       chdir 't' if -d 't';
-       @INC = '../lib';
+    if( $ENV{PERL_CORE} ) {
+        chdir 't' if -d 't';
+        @INC = '../lib';
+    }
 }
+chdir 't';
 
 use Test::More;
 
@@ -18,23 +21,14 @@
 use Config;
 use File::Spec;
 use File::Basename;
+use ExtUtils::MakeMaker;
 
-# Does this mimic ExtUtils::MakeMaker ok?
-{
-    @MM::ISA = qw(
-        ExtUtils::MM_Unix 
-        ExtUtils::Liblist::Kid 
-        ExtUtils::MakeMaker
-    );
-    # MM package faked up by messy MI entanglement
-    package MM;
-    sub DESTROY {}
-}
-
 require_ok( 'ExtUtils::MM_Win32' );
 
 # test import of $Verbose and &neatvalue
 can_ok( 'MM', 'neatvalue' );
+() = $ExtUtils::MM_Win32::Verbose;
+() = $ExtUtils::MakeMaker::Verbose;
 is( $ExtUtils::MM_Win32::Verbose, $ExtUtils::MakeMaker::Verbose, 
        'ExtUtils::MM_Win32 should import $Verbose from ExtUtils::MakeMaker' );
 
@@ -126,12 +120,19 @@
         VERSION_FROM => 'TestMM_Win32',
         PM           => { 'MM_Win32.pm' => 1 },
     }, 'MM';
+
+    # XXX Hack until we have a proper init method.
+    # Flesh out some necessary keys in the MM object.
+    foreach my $key (qw(XS C O_FILES H HTMLLIBPODS HTMLSCRIPTPODS
+                        MAN1PODS MAN3PODS PARENT_NAME)) {
+        $mm_w32{$key} = '';
+    }
     my $s_PM = join( " \\\n\t", sort keys %{$mm_w32->{PM}} );
     my $k_PM = join( " \\\n\t", %{$mm_w32->{PM}} );
 
     like( $mm_w32->constants(),
           qr/^NAME\ =\ TestMM_Win32\s+VERSION\ =\ 1\.00.+
-             MAKEMAKER\ =\ $INC{'ExtUtils\MakeMaker.pm'}\s+
+             MAKEMAKER\ =\ $INC{'ExtUtils/MakeMaker.pm'}\s+
              MM_VERSION\ =\ $ExtUtils::MakeMaker::VERSION.+
              VERSION_FROM\ =\ TestMM_Win32.+
              TO_INST_PM\ =\ \Q$s_PM\E\s+

==== //depot/perl/lib/ExtUtils/t/Manifest.t#3 (text) ====
Index: perl/lib/ExtUtils/t/Manifest.t
--- perl/lib/ExtUtils/t/Manifest.t.~1~  Fri Jan 18 07:45:05 2002
+++ perl/lib/ExtUtils/t/Manifest.t      Fri Jan 18 07:45:05 2002
@@ -1,9 +1,12 @@
-#!./perl 
+#!/usr/bin/perl 
 
 BEGIN {
-    chdir 't' if -d 't';
-    unshift @INC, '../lib';
+    if( $ENV{PERL_CORE} ) {
+        chdir 't' if -d 't';
+        unshift @INC, '../lib';
+    }
 }
+chdir 't';
 
 # these files help the test run
 use Test::More tests => 31;
@@ -41,8 +44,8 @@
 }
 
 # use module, import functions
-use_ok( 'ExtUtils::Manifest', 
-       qw( mkmanifest manicheck filecheck fullcheck maniread manicopy) );
+BEGIN { use_ok( 'ExtUtils::Manifest', 
+        qw( mkmanifest manicheck filecheck fullcheck maniread manicopy) ); }
 
 my $cwd = Cwd::getcwd();
 
@@ -78,8 +81,7 @@
 is( $res, 'bar', 'bar reported as new' );
 
 # now quiet the warning that bar was added and test again
-use vars qw($ExtUtils::Manifest::Quiet);
-$ExtUtils::Manifest::Quiet = 1;
+{ package ExtUtils::Manifest;  use vars qw($Quiet); $Quiet = 1; }
 ($res, $warn) = catch_warning( \&ExtUtils::Manifest::skipcheck );
 cmp_ok( $warn, ,'eq', '', 'disabled warnings' );
 
@@ -135,8 +137,10 @@
                                                'carped about none' );
 
 # tell ExtUtils::Manifest to use a different file
-use vars qw($ExtUtils::Manifest::MANIFEST);
-$ExtUtils::Manifest::MANIFEST = 'albatross';
+{ package ExtUtils::Manifest; 
+  use vars qw($MANIFEST); 
+  $MANIFEST = 'albatross'; 
+}
 
 ($res, $warn) = catch_warning( \&mkmanifest );
 like( $warn, qr/Added to albatross: /, 'using a new manifest file' );

==== //depot/perl/lib/ExtUtils/t/Mkbootstrap.t#3 (text) ====
Index: perl/lib/ExtUtils/t/Mkbootstrap.t
--- perl/lib/ExtUtils/t/Mkbootstrap.t.~1~       Fri Jan 18 07:45:05 2002
+++ perl/lib/ExtUtils/t/Mkbootstrap.t   Fri Jan 18 07:45:05 2002
@@ -1,14 +1,20 @@
-#!./perl -w
+#!/usr/bin/perl -w
 
 BEGIN {
-       chdir 't' if -d 't';
-       @INC = '../lib';
+    if( $ENV{PERL_CORE} ) {
+        chdir 't';
+        @INC = ('../lib', 'lib/');
+    }
+    else {
+        unshift @INC, 't/lib/';
+    }
 }
+chdir 't';
 
 use vars qw( $required );
 use Test::More tests => 18;
 
-use_ok( 'ExtUtils::Mkbootstrap' );
+BEGIN { use_ok( 'ExtUtils::Mkbootstrap' ) }
 
 # Mkbootstrap makes a backup copy of "$_[0].bs" if it exists and is non-zero
 my $file_is_ready;
@@ -38,7 +44,7 @@
 Mkbootstrap('fakeboot');
 ok( !( -f 'fakeboot.bso' ), 'Mkbootstrap should not backup an empty file' );
 
-
+use TieOut;
 my $out = tie *STDOUT, 'TieOut';
 
 # with $Verbose set, it should print status messages about libraries
@@ -118,8 +124,7 @@
        close OUT;
 
        # if $DynaLoader::bscode is set, write its contents to the file
-       # localize the variable to prevent "used only once"
-       local $DynaLoader::bscode;
+    local $DynaLoader::bscode;
        $DynaLoader::bscode = 'Wall';
        $ExtUtils::Mkbootstrap::Verbose = 0;
        
@@ -148,19 +153,3 @@
        # clean things up, even on VMS
        1 while unlink(qw( mkboot.bso boot_BS dasboot.bs .bs ));
 }
-
-package TieOut;
-
-sub TIEHANDLE {
-       bless( \(my $scalar), $_[0]);
-}
-
-sub PRINT {
-       my $self = shift;
-       $$self .= join('', @_);
-}
-
-sub read {
-       my $self = shift;
-       return substr($$self, 0, length($$self), '');
-}

==== //depot/perl/lib/ExtUtils/t/Packlist.t#2 (text) ====
Index: perl/lib/ExtUtils/t/Packlist.t
--- perl/lib/ExtUtils/t/Packlist.t.~1~  Fri Jan 18 07:45:05 2002
+++ perl/lib/ExtUtils/t/Packlist.t      Fri Jan 18 07:45:05 2002
@@ -1,9 +1,12 @@
-#!./perl
+#!/usr/bin/perl -w
 
 BEGIN {
-       chdir 't' if -d 't';
-       @INC = '../lib';
+    if( $ENV{PERL_CORE} ) {
+        chdir 't' if -d 't';
+        @INC = '../lib';
+    }
 }
+chdir 't';
 
 use Test::More tests => 34;
 
@@ -33,7 +36,8 @@
 # test FIRSTKEY and NEXTKEY
 SKIP: {
        $pl->{data}{bar} = 'baz';
-       skip('not enough keys to test FIRSTKEY', 2) unless %{ $pl->{data} } > 2;
+       skip('not enough keys to test FIRSTKEY', 2) 
+      unless keys %{ $pl->{data} } > 2;
 
        # get the first and second key
        my ($first, $second) = keys %{ $pl->{data} };

==== //depot/perl/lib/ExtUtils/t/hints.t#2 (text) ====
Index: perl/lib/ExtUtils/t/hints.t
--- perl/lib/ExtUtils/t/hints.t.~1~     Fri Jan 18 07:45:05 2002
+++ perl/lib/ExtUtils/t/hints.t Fri Jan 18 07:45:05 2002
@@ -3,25 +3,34 @@
 BEGIN {
     if( $ENV{PERL_CORE} ) {
         chdir 't';
-        @INC = '../lib';
+        @INC = ('../lib', 'lib/');
+    }
+    else {
+        unshift @INC, 't/lib/';
     }
 }
 chdir 't';
 
-use Test::More tests => 1;
+use Test::More tests => 2;
 
 mkdir 'hints';
-my $hint = $^O;
-open(HINT, ">hints/$hint.pl") || die "Can't write dummy hints file: $!";
+my $hint_file = "hints/$^O.pl";
+open(HINT, ">$hint_file") || die "Can't write dummy hints file $hint_file: $!";
 print HINT <<'CLOO';
 $self->{CCFLAGS} = 'basset hounds got long ears';
 CLOO
 close HINT;
 
+use TieOut;
 use ExtUtils::MakeMaker;
+
+my $out = tie *STDERR, 'TieOut';
 my $mm = bless {}, 'ExtUtils::MakeMaker';
 $mm->check_hints;
 is( $mm->{CCFLAGS}, 'basset hounds got long ears' );
+is( $out->read, "Processing hints file $hint_file\n" );
+
+package Catch;
 
 
 END {

==== //depot/perl/lib/ExtUtils/t/testlib.t#2 (text) ====
Index: perl/lib/ExtUtils/t/testlib.t
--- perl/lib/ExtUtils/t/testlib.t.~1~   Fri Jan 18 07:45:05 2002
+++ perl/lib/ExtUtils/t/testlib.t       Fri Jan 18 07:45:05 2002
@@ -1,13 +1,25 @@
-#!./perl 
+#!/usr/bin/perl -w
 
 BEGIN {
-    chdir 't' if -d 't';
-    @INC = '../lib';
+    if( $ENV{PERL_CORE} ) {
+        chdir 't' if -d 't';
+        @INC = '../lib';
+    }
 }
+chdir 't';
 
 use Test::More tests => 3;
 
-my @blib_paths = grep { /blib/ } @INC;
+BEGIN { 
+    # non-core tests will have blib in their path.  We remove it
+    # and just use the one in lib/.
+    unless( $ENV{PERL_CORE} ) {
+        @INC = grep !/blib/, @INC;
+        unshift @INC, '../lib';
+    }
+}
+
+my @blib_paths = grep /blib/, @INC;
 is( @blib_paths, 0, 'No blib dirs yet in @INC' );
 
 use_ok( 'ExtUtils::testlib' );

==== //depot/perl/lib/ExtUtils/testlib.pm#7 (text) ====
Index: perl/lib/ExtUtils/testlib.pm
--- perl/lib/ExtUtils/testlib.pm.~1~    Fri Jan 18 07:45:05 2002
+++ perl/lib/ExtUtils/testlib.pm        Fri Jan 18 07:45:05 2002
@@ -1,6 +1,5 @@
 package ExtUtils::testlib;
-$VERSION = substr q$Revision: 1.11 $, 10;
-# $Id: testlib.pm,v 1.11 1996/05/31 08:27:07 k Exp $
+$VERSION = 1.12_01;
 
 use lib qw(blib/arch blib/lib);
 1;
@@ -12,10 +11,12 @@
 
 =head1 SYNOPSIS
 
-C<use ExtUtils::testlib;>
+  use ExtUtils::testlib;
 
 =head1 DESCRIPTION
 
+B<THIS MODULE IS OBSOLETE!>  Use blib instead.
+
 After an extension has been built and before it is installed it may be
 desirable to test it bypassing C<make test>. By adding
 

==== //depot/perl/lib/ExtUtils/Changes#1 (text) ====
Index: perl/lib/ExtUtils/Changes
--- perl/lib/ExtUtils/Changes.~1~       Fri Jan 18 07:45:05 2002
+++ perl/lib/ExtUtils/Changes   Fri Jan 18 07:45:05 2002
@@ -0,0 +1,22 @@
+5.48_03 Thu Jan 17 23:44:38 EST 2002
+    * moved bin/inst to bin/instmodsh
+    * Some Win32 backporting fixes.  The -x switch doesn't seem to
+      work on Win32/5.6.1.
+    * Bug on Win32.  MAKEMAKER variable not set properly.
+    * _02 broke hints files.  Now fixed.
+    - Minor prereq error formatting glitch
+    - ExtUtils::testlib no longer a thin wrapper around blib, now a 
+      thin wrapper around lib like it was.  blib is noisy on 5.6.1.
+    - Nick and chromatic found and fixed some warnings in the tests
+
+5.48_02 Wed Jan 16 19:11:26 EST 2002
+    - Fixed some Win32 warnings.  Needs more work.
+
+5.48_01 Wed Jan 16 15:10:28 EST 200
+    * Adapted from bleadperl@14303
+    * Backported to 5.6.1
+    - inst and xsubpp moved out of lib/ and into bin/
+    - ExtUtils::testlib obsoleted.  Now a thin wrapper around blib.pm
+    ***--> Non-Unix platforms not tested at all!  Please test and report
+           back.  Tests probably only need minor fixes.
+

==== //depot/perl/lib/ExtUtils/instmodsh#1 (text) ====
Index: perl/lib/ExtUtils/instmodsh
--- perl/lib/ExtUtils/instmodsh.~1~     Fri Jan 18 07:45:05 2002
+++ perl/lib/ExtUtils/instmodsh Fri Jan 18 07:45:05 2002
@@ -0,0 +1,139 @@
+#!/usr/local/bin/perl -w
+
+use strict;
+use IO::File;
+use ExtUtils::Packlist;
+use ExtUtils::Installed;
+
+use vars qw($Inst @Modules);
+
+################################################################################
+
+sub do_module($)
+{
+my ($module) = @_;
+my $help = <<EOF;
+Available commands are:
+   f [all|prog|doc]   - List installed files of a given type
+   d [all|prog|doc]   - List the directories used by a module
+   v                  - Validate the .packlist - check for missing files
+   t <tarfile>        - Create a tar archive of the module
+   q                  - Quit the module
+EOF
+print($help);
+while (1)
+   {
+   print("$module cmd? ");
+   my $reply = <STDIN>; chomp($reply);
+   CASE:
+      {
+      $reply =~ /^f\s*/ and do
+         {
+         my $class = (split(' ', $reply))[1];
+         $class = 'all' if (! $class);
+         my @files;
+         if (eval { @files = $Inst->files($module, $class); })
+            {
+            print("$class files in $module are:\n   ",
+                  join("\n   ", @files), "\n");
+            last CASE;
+            }
+         else
+            { print($@); }
+         };
+      $reply =~ /^d\s*/ and do
+         {
+         my $class = (split(' ', $reply))[1];
+         $class = 'all' if (! $class);
+         my @dirs;
+         if (eval { @dirs = $Inst->directories($module, $class); })
+            {
+            print("$class directories in $module are:\n   ",
+                  join("\n   ", @dirs), "\n");
+            last CASE;
+            }
+         else
+            { print($@); }
+         };
+      $reply =~ /^t\s*/ and do
+         {
+         my $file = (split(' ', $reply))[1];
+         my $tmp = "/tmp/inst.$$";
+         if (my $fh = IO::File->new($tmp, "w"))
+            {
+            $fh->print(join("\n", $Inst->files($module)));
+            $fh->close();
+            system("tar cvf $file -I $tmp");
+            unlink($tmp);
+            last CASE;
+            }
+         else { print("Can't open $file: $!\n"); }
+         last CASE;
+         };
+      $reply eq 'v' and do
+         {
+         if (my @missing = $Inst->validate($module))
+            {
+            print("Files missing from $module are:\n   ",
+                  join("\n   ", @missing), "\n");
+            }
+         else
+            {
+            print("$module has no missing files\n");
+            }
+         last CASE;
+         };
+      $reply eq 'q' and do
+         {
+         return;
+         };
+      # Default
+         print($help);
+      }
+   }
+}
+
+################################################################################
+
+sub toplevel()
+{
+my $help = <<EOF;
+Available commands are:
+   l            - List all installed modules
+   m <module>   - Select a module
+   q            - Quit the program
+EOF
+print($help);
+while (1)
+   {
+   print("cmd? ");
+   my $reply = <STDIN>; chomp($reply);
+   CASE:
+      {
+      $reply eq 'l' and do
+         {
+         print("Installed modules are:\n   ", join("\n   ", @Modules), "\n");
+         last CASE;
+         };
+      $reply =~ /^m\s+/ and do
+         {
+         do_module((split(' ', $reply))[1]);
+         last CASE;
+         };
+      $reply eq 'q' and do
+         {
+         exit(0);
+         };
+      # Default
+         print($help);
+      }
+   }
+}
+
+################################################################################
+
+$Inst = ExtUtils::Installed->new();
+@Modules = $Inst->modules();
+toplevel();
+
+################################################################################

==== //depot/perl/t/lib/TieOut.pm#1 (text) ====
Index: perl/t/lib/TieOut.pm
--- perl/t/lib/TieOut.pm.~1~    Fri Jan 18 07:45:05 2002
+++ perl/t/lib/TieOut.pm        Fri Jan 18 07:45:05 2002
@@ -0,0 +1,17 @@
+package TieOut;
+
+sub TIEHANDLE {
+       bless( \(my $scalar), $_[0]);
+}
+
+sub PRINT {
+       my $self = shift;
+       $$self .= join('', @_);
+}
+
+sub read {
+       my $self = shift;
+       return substr($$self, 0, length($$self), '');
+}
+
+1;
End of Patch.

Reply via email to