From: Chris 'BinGOs' Williams Date: Thu, 7 May 2009 17:13:02 +0000 (+0100) Subject: Upgrade to CPANPLUS-Dist-Build-0.26 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4320d0941c269684ff8da26bfeab76ff0809b983;p=p5sagit%2Fp5-mst-13.2.git 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.) --- diff --git a/MANIFEST b/MANIFEST index 583150c..d4a0c15 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1937,6 +1937,9 @@ lib/CPANPLUS/Dist/Build/Constants.pm CPANPLUS::Dist::Build lib/CPANPLUS/Dist/Build.pm CPANPLUS::Dist::Build lib/CPANPLUS/Dist/Build/t/01_CPANPLUS-Dist-Build-Constants.t CPANPLUS::Dist::Build tests lib/CPANPLUS/Dist/Build/t/02_CPANPLUS-Dist-Build.t CPANPLUS::Dist::Build tests +lib/CPANPLUS/Dist/Build/t/dummy-CPAN/authors/01mailrc.txt.gz.packed +lib/CPANPLUS/Dist/Build/t/dummy-CPAN/modules/02packages.details.txt.gz.packed +lib/CPANPLUS/Dist/Build/t/dummy-CPAN/modules/03modlist.data.gz.packed lib/CPANPLUS/Dist/Build/t/inc/conf.pl CPANPLUS::Dist::Build tests lib/CPANPLUS/Dist/Build/t/src/noxs/Foo-Bar-0.01.tar.gz.packed CPANPLUS::Dist::Build tests lib/CPANPLUS/Dist/Build/t/src/xs/Foo-Bar-0.01.tar.gz.packed CPANPLUS::Dist::Build tests diff --git a/lib/CPANPLUS/Dist/Build.pm b/lib/CPANPLUS/Dist/Build.pm index 714ef79..4d4f7fc 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 Ekane@cpan.orgE. Brought to working condition by Ken Williams Ekwilliams@cpan.orgE. -Other hackery and currently maintained by Chris 'BinGOs' Williams ( no relation ). Ebingos@cpan.orgE. +Other hackery and currently maintained by Chris C Williams ( no relation ). Ebingos@cpan.orgE. =head1 LICENSE diff --git a/lib/CPANPLUS/Dist/Build/Constants.pm b/lib/CPANPLUS/Dist/Build/Constants.pm index 2a60438..fba2f9a 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 f92d862..143d71e 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 0000000..0deb147 --- /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 0000000..e9bab39 --- /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'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=[4W2XME/,!'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:$'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 0000000..556b9dc --- /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@H*5&\@-4HV341&1SI3)@I-4ELR44Q*3C4S +M5%Q()5Q)-S-+/DA+,$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 bd75428..c884fd8 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;