summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris 'BinGOs' Williams <chris@bingosnet.co.uk>2009-05-07 18:13:02 +0100
committerSteve Hay <SteveHay@planit.com>2009-05-07 18:14:16 +0100
commit4320d0941c269684ff8da26bfeab76ff0809b983 (patch)
tree78909282138d13b7f6f832a1c206be95536a9540 /lib
parent3ecadf9633330795163fd87481c668fa7b6bcc31 (diff)
downloadperl-4320d0941c269684ff8da26bfeab76ff0809b983.tar.gz
Upgrade to CPANPLUS-Dist-Build-0.26
Stops tests from fetching CPAN indexes. Message-ID: <20090507162935.GA29922@klanker.bingosnet.co.uk> (Tweaked to update MANIFEST too.)
Diffstat (limited to 'lib')
-rw-r--r--lib/CPANPLUS/Dist/Build.pm4
-rw-r--r--lib/CPANPLUS/Dist/Build/Constants.pm2
-rw-r--r--lib/CPANPLUS/Dist/Build/t/02_CPANPLUS-Dist-Build.t17
-rw-r--r--lib/CPANPLUS/Dist/Build/t/dummy-CPAN/authors/01mailrc.txt.gz.packed19
-rw-r--r--lib/CPANPLUS/Dist/Build/t/dummy-CPAN/modules/02packages.details.txt.gz.packed26
-rw-r--r--lib/CPANPLUS/Dist/Build/t/dummy-CPAN/modules/03modlist.data.gz.packed42
-rw-r--r--lib/CPANPLUS/Dist/Build/t/inc/conf.pl207
7 files changed, 277 insertions, 40 deletions
diff --git a/lib/CPANPLUS/Dist/Build.pm b/lib/CPANPLUS/Dist/Build.pm
index 714ef79ae2..4d4f7fc06d 100644
--- a/lib/CPANPLUS/Dist/Build.pm
+++ b/lib/CPANPLUS/Dist/Build.pm
@@ -30,7 +30,7 @@ use Locale::Maketext::Simple Class => 'CPANPLUS', Style => 'gettext';
local $Params::Check::VERBOSE = 1;
-$VERSION = '0.24';
+$VERSION = '0.26';
=pod
@@ -773,7 +773,7 @@ sub _buildflags_as_list {
Originally by Jos Boumans E<lt>kane@cpan.orgE<gt>. Brought to working
condition by Ken Williams E<lt>kwilliams@cpan.orgE<gt>.
-Other hackery and currently maintained by Chris 'BinGOs' Williams ( no relation ). E<lt>bingos@cpan.orgE<gt>.
+Other hackery and currently maintained by Chris C<BinGOs> Williams ( no relation ). E<lt>bingos@cpan.orgE<gt>.
=head1 LICENSE
diff --git a/lib/CPANPLUS/Dist/Build/Constants.pm b/lib/CPANPLUS/Dist/Build/Constants.pm
index 2a60438a09..fba2f9a6b9 100644
--- a/lib/CPANPLUS/Dist/Build/Constants.pm
+++ b/lib/CPANPLUS/Dist/Build/Constants.pm
@@ -9,7 +9,7 @@ BEGIN {
require Exporter;
use vars qw[$VERSION @ISA @EXPORT];
- $VERSION = '0.24';
+ $VERSION = '0.26';
@ISA = qw[Exporter];
@EXPORT = qw[ BUILD_DIR BUILD ];
}
diff --git a/lib/CPANPLUS/Dist/Build/t/02_CPANPLUS-Dist-Build.t b/lib/CPANPLUS/Dist/Build/t/02_CPANPLUS-Dist-Build.t
index f92d86282a..143d71ee82 100644
--- a/lib/CPANPLUS/Dist/Build/t/02_CPANPLUS-Dist-Build.t
+++ b/lib/CPANPLUS/Dist/Build/t/02_CPANPLUS-Dist-Build.t
@@ -34,9 +34,15 @@ my $Lib = File::Spec->rel2abs(File::Spec->catdir( qw[dummy-perl] ));
my $Src = File::Spec->rel2abs(File::Spec->catdir( qw[src] ));
my $Verbose = @ARGV ? 1 : 0;
-my $CB = CPANPLUS::Backend->new;
-my $Conf = $CB->configure_object;
+my $Conf = gimme_conf();
+my $CB = CPANPLUS::Backend->new( $Conf );
+#$Conf->set_conf( base => 'dummy-cpanplus' );
+#$Conf->set_conf( dist_type => '' );
+#$Conf->set_conf( verbose => $Verbose );
+#$Conf->set_conf( signature => 0 );
+### running tests will mess with the test output so skip 'm
+#$Conf->set_conf( skiptest => 1 );
### create a fake object, so we don't use the actual module tree
### make sure to add dslip data, so CPANPLUS doesn't try to find
@@ -50,13 +56,6 @@ my $Mod = CPANPLUS::Module::Fake->new(
dslip => 'RdpO?',
);
-$Conf->set_conf( base => 'dummy-cpanplus' );
-$Conf->set_conf( dist_type => '' );
-$Conf->set_conf( verbose => $Verbose );
-$Conf->set_conf( signature => 0 );
-### running tests will mess with the test output so skip 'm
-$Conf->set_conf( skiptest => 1 );
-
### dmq tells us that we should run with /nologo
### if using nmake, as it's very noise otherwise.
### XXX copied from CPANPLUS' test include file!
diff --git a/lib/CPANPLUS/Dist/Build/t/dummy-CPAN/authors/01mailrc.txt.gz.packed b/lib/CPANPLUS/Dist/Build/t/dummy-CPAN/authors/01mailrc.txt.gz.packed
new file mode 100644
index 0000000000..0deb14772f
--- /dev/null
+++ b/lib/CPANPLUS/Dist/Build/t/dummy-CPAN/authors/01mailrc.txt.gz.packed
@@ -0,0 +1,19 @@
+#########################################################################
+This is a binary file that was packed with the 'uupacktool.pl' which
+is included in the Perl distribution.
+
+To unpack this file use the following command:
+
+ uupacktool.pl -u 01mailrc.txt.gz.packed 01mailrc.txt.gz
+
+To recreate it use the following command:
+
+ uupacktool.pl -p 01mailrc.txt.gz 01mailrc.txt.gz.packed
+
+Created at Thu May 7 17:18:27 2009
+#########################################################################
+__UU__
+M'XL("*':`DH``S`Q;6%I;')C+G1X=`!+S,E,+%9P#8T(5@`#)=>*DM"2S)QB
+M*RO?Q.Q4$"Y2`$HZYZ>D*M@D%R3F%>24%CND5B3F%N2DZB7GY]HI<25"#?'S
+MAQB#U1"_?"+-\76".\8W/Z4T)]7*RJDT,R>%:.UP9Z!J]_,GT@0G3S]W_V!.
+M)>>,HLQBA?#,'*!H;C%04T91L4-29EYZ?G%>:@E0BUYI-E`3`#./"ZY#`0``
diff --git a/lib/CPANPLUS/Dist/Build/t/dummy-CPAN/modules/02packages.details.txt.gz.packed b/lib/CPANPLUS/Dist/Build/t/dummy-CPAN/modules/02packages.details.txt.gz.packed
new file mode 100644
index 0000000000..e9bab39cc1
--- /dev/null
+++ b/lib/CPANPLUS/Dist/Build/t/dummy-CPAN/modules/02packages.details.txt.gz.packed
@@ -0,0 +1,26 @@
+#########################################################################
+This is a binary file that was packed with the 'uupacktool.pl' which
+is included in the Perl distribution.
+
+To unpack this file use the following command:
+
+ uupacktool.pl -u 02packages.details.txt.gz.packed 02packages.details.txt.gz
+
+To recreate it use the following command:
+
+ uupacktool.pl -p 02packages.details.txt.gz 02packages.details.txt.gz.packed
+
+Created at Thu May 7 17:19:10 2009
+#########################################################################
+__UU__
+M'XL("-3:`DH``S`R<&%C:V%G97,N9&5T86EL<RYT>'0`G=-!;]L@%`?P<_PI
+MWF&'30J8.K(J<5J<)E6W)(V66>UMHH8F:#98\%PO^_2#9%W;:-G6(4N6X,^/
+M!X*9KA6'Q\:R5E1?Q49Y*A4*77N*WS`I/\V?,K!%;'F:]GU/6^5J6MDFG:S&
+MR[2QLJN53T\H%\I73K>HK0G:ZA`!(QKEX=YV1H(V(+53%5JW@S=[4W2XM<ZG
+M6J;)Q-9=8_S/4MIGP!`>E/,!'H9NW"97!I612I*9=1S&'=I&H))PK[#:@K,=
+M:J/\\+!X@!1(6W6-,BAB>32Y<1H#08I=7*VII?;8BSCY[0-D=,2R=W"W@[&1
+M3@E//UIE].:],+H18<_)//!D$O:$<?H9.\_S9"X\DK*5L1`.-TH.8<3@@S"0
+M,98!RWD6OG.X7'Q.DIFUG!?"<3XM.;]=PU%CE)W%_[2\7:<A3$*6Q$Z*PM'-
+M]V?`HO@3L"C^"5A>'Q-/0!S["Q$W<9J8EJ\@.%]W=_]#')_`*X@B7,[P3/@I
+MZH@XQ,GOI$DO3]6Q;]E+*;ZOG#*6?V&C7T1X%JMY&0[B(ES*4$^G:SD8Q%4&
+9Q=7R\GJ=/D9(3)!]X$45/P`_H+;"]0,`````
diff --git a/lib/CPANPLUS/Dist/Build/t/dummy-CPAN/modules/03modlist.data.gz.packed b/lib/CPANPLUS/Dist/Build/t/dummy-CPAN/modules/03modlist.data.gz.packed
new file mode 100644
index 0000000000..556b9dce97
--- /dev/null
+++ b/lib/CPANPLUS/Dist/Build/t/dummy-CPAN/modules/03modlist.data.gz.packed
@@ -0,0 +1,42 @@
+#########################################################################
+This is a binary file that was packed with the 'uupacktool.pl' which
+is included in the Perl distribution.
+
+To unpack this file use the following command:
+
+ uupacktool.pl -u 03modlist.data.gz.packed 03modlist.data.gz
+
+To recreate it use the following command:
+
+ uupacktool.pl -p 03modlist.data.gz 03modlist.data.gz.packed
+
+Created at Thu May 7 17:19:15 2009
+#########################################################################
+__UU__
+M(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C
+M(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C(PI4:&ES(&ES(&$@8FEN87)Y
+M(&9I;&4@=&AA="!W87,@<&%C:V5D('=I=&@@=&AE("=U=7!A8VMT;V]L+G!L
+M)R!W:&EC:`II<R!I;F-L=61E9"!I;B!T:&4@4&5R;"!D:7-T<FEB=71I;VXN
+M"@I4;R!U;G!A8VL@=&AI<R!F:6QE('5S92!T:&4@9F]L;&]W:6YG(&-O;6UA
+M;F0Z"@H@("`@('5U<&%C:W1O;VPN<&P@+74@,#-M;V1L:7-T+F1A=&$N9WH@
+M,#)P86-K86=E<RYD971A:6QS+G1X="YG>@H*5&\@<F5C<F5A=&4@:70@=7-E
+M('1H92!F;VQL;W=I;F<@8V]M;6%N9#H*"B`@("`@=75P86-K=&]O;"YP;"`M
+M<"`P,G!A8VMA9V5S+F1E=&%I;',N='AT+F=Z(#`S;6]D;&ES="YD871A+F=Z
+M"@I#<F5A=&5D(&%T(%1H=2!-87D@(#<@,3<Z,3@Z-3@@,C`P.0HC(R,C(R,C
+M(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C(R,C
+M(R,C(R,C(R,C(R,C(R,C(R,C(R,C"E]?555?7PI-)UA,*"(M,SI@1$A@8%-@
+M4CPF)4,Z5B5'.3<L3CDF-50X-D5,/%)95#XG,&!'/2TA.UU,0"5@/U`\7U!)
+M"DU71B8G,S!*."Y+*$H\-4H\*44V5RDH5C8V/E5-2$@X1CHC.3A<)5!/7E\R
+M(SDE5SLZ+4<V*#1.-E@L7B\*32%8*CE+038G45PZ4C5%,3]1-#E9*D$T*C<W
+M3BI74V!)+UQ6/RQ+(24[)T8Z74=5+S9>-4HV341&1SI3)@I-4ELR44Q*3C4S
+M5%Q()5Q)-S-+/DA+,$<Z6D%@(2A12T58/5E6,4@H5B@K-3,E-4I70%,]6S17
+M,EA-/%I'"DTV2CLI42TY/3A?4R\T34E'4"%@/D4O+"$G2#E.5R(Y-R%)-C$R
+M22HY/3%3)B<]229(*2E02ULC.D!++#T*33I*+UQ<*R%80"$Q*#97-BTL0D%"
+M/C,R63PQ2",P.$D]-RI624D_.SA"4T-96S`M1#TL,E(]5R)70%LF,0I-,T!%
+M+R]5245=+CI=+"M(,3@\7RDO+R%$)$\Z)#P_2#DN7%]3.2)87$1+*C5,,6`N
+M+51(+C@\,T!`4R(P"DTL.3@A4E=$-D]'+E@W)U$N1$E&54<A/R(\,UA-+CM=
+M/5!5)4-%*5<E7ULR7#<Z/$$S)"HV421:*E!-)RT*35U6/V!(3T`S3")#7B(U
+M03XG42TO,"%36R)1)%<\.4HX14I<0"XE75<]7UTC)RE?8"I80$(W+%M0,R]`
+M20I-6DA`6%$L1T]))$1/,UTV43M=12LJ.UI/1R,J-C]6)D,W5#%8)4I-628P
+M6T(H15,J-"1>1SI31#A1)30F"CE1/3=27$=*/2]$.2@S*2%=6"0T-2]08%](
+,*SLB73`L8&!@8&`*
diff --git a/lib/CPANPLUS/Dist/Build/t/inc/conf.pl b/lib/CPANPLUS/Dist/Build/t/inc/conf.pl
index bd754280fb..c884fd886b 100644
--- a/lib/CPANPLUS/Dist/Build/t/inc/conf.pl
+++ b/lib/CPANPLUS/Dist/Build/t/inc/conf.pl
@@ -31,7 +31,7 @@ BEGIN {
### and friends get picked up
$old_env_path = $ENV{PATH};
$ENV{'PATH'} = join $Config{'path_sep'},
- grep { defined } "$FindBin::Bin/../../../bin", $ENV{'PATH'};
+ grep { defined } "$FindBin::Bin/../bin", $ENV{'PATH'};
### Fix up the path to perl, as we're about to chdir
### but only under perlcore, or if the path contains delimiters,
@@ -85,16 +85,169 @@ use File::Basename qw[basename];
$Locale::Maketext::Lexicon::VERSION = 0;
}
-### clean up files for PERLCORE mostly -- make clean isn't invoked
-### there... otoh, we should clean up after ourselves anyway.
-END {
- ### chdir to our own test dir, so we know all files are relative
- ### to this point, no matter whether run from perlcore tests or
- ### regular CPAN installs
- chdir "$FindBin::Bin" if -d "$FindBin::Bin";
+my $Env = 'PERL5_CPANPLUS_TEST_VERBOSE';
+
+# prereq has to be in our package file && core!
+use constant TEST_CONF_PREREQ => 'Cwd';
+use constant TEST_CONF_MODULE => 'Foo::Bar::EU::NOXS';
+use constant TEST_CONF_MODULE_SUB => 'Foo::Bar::EU::NOXS::Sub';
+use constant TEST_CONF_AUTHOR => 'EUNOXS';
+use constant TEST_CONF_INST_MODULE => 'Foo::Bar';
+use constant TEST_CONF_INVALID_MODULE => 'fnurk';
+use constant TEST_CONF_MIRROR_DIR => 'dummy-localmirror';
+use constant TEST_CONF_CPAN_DIR => 'dummy-CPAN';
+use constant TEST_CONF_CPANPLUS_DIR => 'dummy-cpanplus';
+use constant TEST_CONF_INSTALL_DIR => File::Spec->rel2abs(
+ File::Spec->catdir(
+ TEST_CONF_CPANPLUS_DIR,
+ 'install'
+ )
+ );
+
+### we might need this Some Day when we're installing into
+### our own sandbox. see t/20.t for details
+# use constant TEST_INSTALL_DIR => do {
+# my $dir = File::Spec->rel2abs( 'dummy-perl' );
+#
+# ### clean up paths if we are on win32
+# ### dirs with spaces will be.. bad :(
+# $^O eq 'MSWin32'
+# ? Win32::GetShortPathName( $dir )
+# : $dir;
+# };
+
+# use constant TEST_INSTALL_DIR_LIB
+# => File::Spec->catdir( TEST_INSTALL_DIR, 'lib' );
+# use constant TEST_INSTALL_DIR_BIN
+# => File::Spec->catdir( TEST_INSTALL_DIR, 'bin' );
+# use constant TEST_INSTALL_DIR_MAN1
+# => File::Spec->catdir( TEST_INSTALL_DIR, 'man', 'man1' );
+# use constant TEST_INSTALL_DIR_MAN3
+# => File::Spec->catdir( TEST_INSTALL_DIR, 'man', 'man3' );
+# use constant TEST_INSTALL_DIR_ARCH
+# => File::Spec->catdir( TEST_INSTALL_DIR, 'arch' );
+#
+# use constant TEST_INSTALL_EU_MM_FLAGS =>
+# ' INSTALLDIRS=site' .
+# ' INSTALLSITELIB=' . TEST_INSTALL_DIR_LIB .
+# ' INSTALLSITEARCH=' . TEST_INSTALL_DIR_ARCH . # .packlist
+# ' INSTALLARCHLIB=' . TEST_INSTALL_DIR_ARCH . # perllocal.pod
+# ' INSTALLSITEBIN=' . TEST_INSTALL_DIR_BIN .
+# ' INSTALLSCRIPT=' . TEST_INSTALL_DIR_BIN .
+# ' INSTALLSITEMAN1DIR=' . TEST_INSTALL_DIR_MAN1 .
+# ' INSTALLSITEMAN3DIR=' . TEST_INSTALL_DIR_MAN3;
+
+
+sub dummy_cpan_dir {
+ ### VMS needs this in directory format for rel2abs
+ my $test_dir = $^O eq 'VMS'
+ ? File::Spec->catdir(TEST_CONF_CPAN_DIR)
+ : TEST_CONF_CPAN_DIR;
+
+ ### Convert to an absolute file specification
+ my $abs_test_dir = File::Spec->rel2abs($test_dir);
+
+ ### According to John M: the hosts path needs to be in UNIX format.
+ ### File::Spec::Unix->rel2abs does not work at all on VMS
+ $abs_test_dir = VMS::Filespec::unixify( $abs_test_dir ) if $^O eq 'VMS';
- ### XXX hardcoded
- _clean_test_dir( [qw|dummy-perl dummy-cpanplus| ] );
+ return $abs_test_dir;
+}
+
+sub gimme_conf {
+
+ ### don't load any other configs than the heuristic one
+ ### during tests. They might hold broken/incorrect data
+ ### for our test suite. Bug [perl #43629] showed this.
+ my $conf = CPANPLUS::Configure->new( load_configs => 0 );
+
+ my $dummy_cpan = dummy_cpan_dir();
+
+ $conf->set_conf( hosts => [ {
+ path => $dummy_cpan,
+ scheme => 'file',
+ } ],
+ );
+ $conf->set_conf( base => File::Spec->rel2abs(TEST_CONF_CPANPLUS_DIR));
+ $conf->set_conf( dist_type => '' );
+ $conf->set_conf( signature => 0 );
+ $conf->set_conf( verbose => 1 ) if $ENV{ $Env };
+
+ ### never use a pager in the test suite
+ $conf->set_program( pager => '' );
+
+ ### dmq tells us that we should run with /nologo
+ ### if using nmake, as it's very noisy otherwise.
+ { my $make = $conf->get_program('make');
+ if( $make and basename($make) =~ /^nmake/i ) {
+ $conf->set_conf( makeflags => '/nologo' );
+ }
+ }
+
+ $conf->set_conf( source_engine => $ENV{CPANPLUS_SOURCE_ENGINE} )
+ if $ENV{CPANPLUS_SOURCE_ENGINE};
+
+ _clean_test_dir( [
+ $conf->get_conf('base'),
+ TEST_CONF_MIRROR_DIR,
+# TEST_INSTALL_DIR_LIB,
+# TEST_INSTALL_DIR_BIN,
+# TEST_INSTALL_DIR_MAN1,
+# TEST_INSTALL_DIR_MAN3,
+ ], ( $ENV{PERL_CORE} ? 0 : 1 ) );
+
+ return $conf;
+};
+
+{
+ my $fh;
+ my $file = ".".basename($0).".output";
+ sub output_handle {
+ return $fh if $fh;
+
+ $fh = FileHandle->new(">$file")
+ or warn "Could not open output file '$file': $!";
+
+ $fh->autoflush(1);
+ return $fh;
+ }
+
+ sub output_file { return $file }
+
+
+
+ ### redirect output from msg() and error() output to file
+ unless( $ENV{$Env} ) {
+
+ print "# To run tests in verbose mode, set ".
+ "\$ENV{$Env} = 1\n" unless $ENV{PERL_CORE};
+
+ 1 while unlink $file; # just in case
+
+ $CPANPLUS::Error::ERROR_FH =
+ $CPANPLUS::Error::ERROR_FH = output_handle();
+
+ $CPANPLUS::Error::MSG_FH =
+ $CPANPLUS::Error::MSG_FH = output_handle();
+
+ }
+}
+
+
+### clean these files if we're under perl core
+END {
+ if ( $ENV{PERL_CORE} ) {
+ close output_handle(); 1 while unlink output_file();
+
+ _clean_test_dir( [
+ gimme_conf->get_conf('base'),
+ TEST_CONF_MIRROR_DIR,
+ # TEST_INSTALL_DIR_LIB,
+ # TEST_INSTALL_DIR_BIN,
+ # TEST_INSTALL_DIR_MAN1,
+ # TEST_INSTALL_DIR_MAN3,
+ ], 0 ); # DO NOT be verbose under perl core -- makes tests fail
+ }
}
### whenever we start a new script, we want to clean out our
@@ -115,31 +268,30 @@ sub _clean_test_dir {
my $path = File::Spec->catfile( $dir, $file );
- ### John Malmberg reports yet another VMS issue:
- ### A directory name on VMS in VMS format ends with .dir
- ### when it is referenced as a file.
- ### In UNIX format traditionally PERL on VMS does not remove the
- ### '.dir', however the VMS C library conversion routines do remove
- ### the '.dir' and the VMS C library routines can not handle the
- ### '.dir' being present on UNIX format filenames.
- ### So code doing the fixup has on VMS has to be able to handle both
- ### UNIX format names and VMS format names.
- ### XXX See http://www.xray.mpe.mpg.de/
- ### mailing-lists/perl5-porters/2007-10/msg00064.html
- ### for details -- the below regex could use some touchups
- ### according to John. M.
-
### directory, rmtree it
if( -d $path ) {
+ ### John Malmberg reports yet another VMS issue:
+ ### A directory name on VMS in VMS format ends with .dir
+ ### when it is referenced as a file.
+ ### In UNIX format traditionally PERL on VMS does not remove the
+ ### '.dir', however the VMS C library conversion routines do
+ ### remove the '.dir' and the VMS C library routines can not
+ ### handle the '.dir' being present on UNIX format filenames.
+ ### So code doing the fixup has on VMS has to be able to handle
+ ### both UNIX format names and VMS format names.
+
+ ### XXX See http://www.xray.mpe.mpg.de/
+ ### mailing-lists/perl5-porters/2007-10/msg00064.html
+ ### for details -- the below regex could use some touchups
+ ### according to John. M.
$file =~ s/\.dir$//i if $^O eq 'VMS';
-
- ### Need a path specification here, not a file.
+
my $dirpath = File::Spec->catdir( $dir, $file );
print "# Deleting directory '$dirpath'\n" if $verbose;
eval { rmtree( $dirpath ) };
- warn "Could not delete '$dirpath' while cleaning up '$dir'"
+ warn "Could not delete '$dirpath' while cleaning up '$dir'"
if $@;
### regular file
@@ -154,5 +306,4 @@ sub _clean_test_dir {
return 1;
}
-
1;