module-build-checkins Mailing List for Module::Build (Page 25)
Status: Beta
Brought to you by:
kwilliams
You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(82) |
Dec
(58) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(49) |
Feb
(57) |
Mar
(49) |
Apr
(49) |
May
(2) |
Jun
(147) |
Jul
(60) |
Aug
(55) |
Sep
(51) |
Oct
(68) |
Nov
(61) |
Dec
(44) |
| 2006 |
Jan
(27) |
Feb
(38) |
Mar
(89) |
Apr
(31) |
May
(17) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Randy W. S. <si...@us...> - 2005-06-23 07:58:17
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29485/t Modified Files: notes.t Log Message: use Test::More Index: notes.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/notes.t,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- notes.t 10 May 2004 03:24:02 -0000 1.8 +++ notes.t 23 Jun 2005 07:58:08 -0000 1.9 @@ -1,7 +1,7 @@ - +use lib 't/lib'; use strict; -use Test; -plan tests => 9; + +use Test::More tests => 9; use Module::Build; ok(1); @@ -10,19 +10,19 @@ my $m = Module::Build->current; # This was set in Build.PL -ok $m->notes('foo'), 'bar'; +is $m->notes('foo'), 'bar'; # Try setting & checking a new value $m->notes(argh => 'new'); -ok $m->notes('argh'), 'new'; +is $m->notes('argh'), 'new'; # Change existing value $m->notes(foo => 'foo'); -ok $m->notes('foo'), 'foo'; +is $m->notes('foo'), 'foo'; # Change back so we can run this test again successfully $m->notes(foo => 'bar'); -ok $m->notes('foo'), 'bar'; +is $m->notes('foo'), 'bar'; ################################### # Make sure notes set before create_build_script() get preserved @@ -31,10 +31,10 @@ $m = Module::Build->new(module_name => 'Sample'); ok $m; $m->notes(foo => 'bar'); -ok $m->notes('foo'), 'bar'; +is $m->notes('foo'), 'bar'; $m->create_build_script; $m = Module::Build->resume; ok $m; -ok $m->notes('foo'), 'bar'; +is $m->notes('foo'), 'bar'; |
|
From: Randy W. S. <si...@us...> - 2005-06-23 07:56:07
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28487/t Modified Files: files.t Log Message: Use the DistGen module for tests. Index: files.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/files.t,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- files.t 23 Jun 2005 07:46:32 -0000 1.3 +++ files.t 23 Jun 2005 07:55:52 -0000 1.4 @@ -1,16 +1,27 @@ - +use lib 't/lib'; use strict; use Test::More tests => 6; + use File::Spec; use IO::File; + +use Cwd (); +my $cwd = Cwd::cwd; + +use DistGen; +my $dist = DistGen->new; +$dist->regen; + +chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; + + use Module::Build; ok(1); - -my $m = Module::Build->current; +my $m = Module::Build->new_from_context; my @files; { @@ -42,4 +53,5 @@ ok -e $file2; } -$m->delete_filetree(@files); +chdir( $cwd ) or die "Can''t chdir to '$cwd': $!"; +$dist->remove; |
|
From: Randy W. S. <si...@us...> - 2005-06-23 07:46:40
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23650/t Modified Files: files.t Log Message: use Test::More Index: files.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/files.t,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- files.t 10 May 2004 03:27:55 -0000 1.2 +++ files.t 23 Jun 2005 07:46:32 -0000 1.3 @@ -1,10 +1,11 @@ use strict; -use Test; -plan tests => 6; + +use Test::More tests => 6; use File::Spec; use IO::File; + use Module::Build; ok(1); @@ -23,7 +24,7 @@ unless (-d $tmp) { mkdir($tmp, 0777) or die "Can't create $tmp: $!"; } - ok -d $tmp, 1; + ok -d $tmp; $tmp[$_] = $tmp; } @@ -33,12 +34,12 @@ my $fh = IO::File->new($file, '>') or die "Can't create $file: $!"; print $fh "Foo\n"; $fh->close; - ok -e $file, 1; + ok -e $file; my $file2 = $m->copy_if_modified(from => $file, to_dir => $tmp[2]); ok $file2; - ok -e $file2, 1; + ok -e $file2; } $m->delete_filetree(@files); |
|
From: Randy W. S. <si...@us...> - 2005-06-23 07:31:40
|
Update of /cvsroot/module-build/Module-Build/t/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15171/t/lib Modified Files: DistGen.pm Log Message: Store the absolute path of the created distribution. Index: DistGen.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/lib/DistGen.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- DistGen.pm 15 Apr 2005 03:10:54 -0000 1.3 +++ DistGen.pm 23 Jun 2005 07:31:27 -0000 1.4 @@ -20,7 +20,7 @@ my %options = @_; $options{name} ||= 'Simple'; - $options{dir} ||= File::Spec->curdir(); + $options{dir} ||= Cwd::cwd(); my %data = ( skip_manifest => 0, @@ -222,6 +222,7 @@ my $here = Cwd::abs_path(); my $there = File::Spec->rel2abs( $self->dirname() ); + if ( -d $there ) { chdir( $there ) or die "Can't change directory to '$there'\n"; } else { |
|
From: Randy W. S. <si...@us...> - 2005-06-23 07:30:30
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14486/t Modified Files: tilde.t Log Message: Use DistGen to generate distribution for tests. Use new_from_context() to run 'Build.PL', and capture Module::Build output with stdout_of() from 't/common.pl' Index: tilde.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/tilde.t,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- tilde.t 23 Jun 2005 02:54:18 -0000 1.6 +++ tilde.t 23 Jun 2005 07:30:17 -0000 1.7 @@ -5,28 +5,35 @@ use lib 't/lib'; use strict; +use File::Spec (); +my $common_pl = File::Spec->catfile( 't', 'common.pl' ); +require $common_pl; + use Test::More tests => 10; -use TieOut; -use Cwd; -use File::Spec::Functions qw(catdir); use Module::Build; -my $cwd = cwd; +use Cwd (); +my $cwd = Cwd::cwd; + +use DistGen; +my $dist = DistGen->new; +$dist->regen; + +chdir( $dist->dirname ) or die "Can't chdir to '@{[$dist->dirname]}': $!"; sub run_sample { - my($args) = @_; + my @args = @_; local $Test::Builder::Level = $Test::Builder::Level + 1; - chdir 'Sample'; - - Module::Build->run_perl_script('Build.PL', [], [@$args, '--quiet=1']); + $dist->clean; - my $mb = Module::Build->current; + my $mb; + stdout_of( sub { + $mb = Module::Build->new_from_context( @args ); + } ); - chdir $cwd; - return $mb; } @@ -36,33 +43,37 @@ my $mb; - $mb = run_sample( ['--install_base=~']); + $mb = run_sample( install_base => '~' ); is( $mb->install_base, $ENV{HOME} ); - $mb = run_sample( ['--install_base=~/foo'], qr{^$ENV{HOME}/foo} ); + $mb = run_sample( install_base => '~/foo' ); is( $mb->install_base, "$ENV{HOME}/foo" ); - $mb = run_sample( ['--install_base=~~'] ); + $mb = run_sample( install_base => '~~' ); is( $mb->install_base, '~~' ); - $mb = run_sample( ['--install_base=foo~'] ); + $mb = run_sample( install_base => 'foo~' ); is( $mb->install_base, 'foo~' ); - $mb = run_sample( ['--prefix=~'] ); + $mb = run_sample( prefix => '~' ); is( $mb->prefix, $ENV{HOME} ); - $mb = run_sample( ['--install_path', 'html=~/html', - '--install_path', 'lib=~/lib' - ] ); + $mb = run_sample( install_path => { html => '~/html', + lib => '~/lib' } + ); is( $mb->install_destination('lib'), "$ENV{HOME}/lib" ); is( $mb->install_destination('html'), "$ENV{HOME}/html" ); - $mb = run_sample( ['--install_path', 'lib=~/lib'] ); + $mb = run_sample( install_path => { lib => '~/lib' } ); is( $mb->install_destination('lib'), "$ENV{HOME}/lib" ); - $mb = run_sample( ['--destdir=~'] ); + $mb = run_sample( destdir => '~' ); is( $mb->destdir, $ENV{HOME} ); $mb->install_base('~'); is( $mb->install_base, '~', 'API does not expand tildes' ); } + + +chdir( $cwd ) or die "Can''t chdir to '$cwd': $!"; +$dist->remove; |
|
From: Randy W. S. <si...@us...> - 2005-06-23 07:26:05
|
Update of /cvsroot/module-build/Module-Build/t/Sample In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11275/t/Sample Modified Files: MANIFEST Log Message: Oops. Testing before comitting regenerated the file. Index: MANIFEST =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/Sample/MANIFEST,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- MANIFEST 23 Jun 2005 07:17:43 -0000 1.7 +++ MANIFEST 23 Jun 2005 07:25:56 -0000 1.8 @@ -7,4 +7,3 @@ MANIFEST script test.pl -META.yml |
|
From: Randy W. S. <si...@us...> - 2005-06-23 07:17:52
|
Update of /cvsroot/module-build/Module-Build/t/Sample In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6576/t/Sample Modified Files: MANIFEST Log Message: META.yml is no longer present in the Sample distribution. Index: MANIFEST =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/Sample/MANIFEST,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- MANIFEST 21 Feb 2004 04:56:04 -0000 1.6 +++ MANIFEST 23 Jun 2005 07:17:43 -0000 1.7 @@ -5,6 +5,6 @@ lib/Sample/NoPod.pm lib/Sample/Script.PL MANIFEST -META.yml script test.pl +META.yml |
|
From: Ken W. <kwi...@us...> - 2005-06-23 04:35:55
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22572/lib/Module/Build Modified Files: Base.pm Log Message: Rename prefix_sets to original_prefix. Make prefix_relative() return a relative path, just like install_base_relative(). This helps the caller see in install_destination() that the result is guaranteed to be inside the specified prefix directory. Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.443 retrieving revision 1.444 diff -u -d -r1.443 -r1.444 --- Base.pm 23 Jun 2005 02:44:52 -0000 1.443 +++ Base.pm 23 Jun 2005 04:35:46 -0000 1.444 @@ -203,14 +203,14 @@ }, }; - $p->{prefix_sets} = + $p->{original_prefix} = { core => $c->{installprefixexp} || $c->{installprefix} || $c->{prefixexp} || $c->{prefix} || '', site => $c->{siteprefixexp}, vendor => $c->{usevendorprefix} ? $c->{vendorprefixexp} : '', }; - $p->{prefix_sets}{site} ||= $p->{prefix_sets}{core}; + $p->{original_prefix}{site} ||= $p->{original_prefix}{core}; $p->{install_base_relpaths} = { @@ -542,7 +542,7 @@ has_config_data install_sets install_base_relpaths - prefix_sets + original_prefix prefix_relpaths install_base destdir @@ -2642,12 +2642,13 @@ sub prefix_relative { my ($self, $type) = @_; my $installdirs = $self->installdirs; - + + # XXX the 'return' here is not a very good failure mechanism my $normal_location = $self->install_sets->{$installdirs}{$type} or return; return $self->_prefixify($normal_location, - $self->prefix_sets->{$installdirs}, + $self->original_prefix->{$installdirs}, $self->prefix, $self->prefix_relpaths($installdirs, $type), ); @@ -2689,7 +2690,11 @@ $self->log_verbose(" now $path\n"); - return $path; + # Return a path relative to $rprefix (this is kind of silly for now, + # because the caller is just going to cat them back together again, + # but prefix_relative() and install_base_relative() should have the + # same interface). + return File::Spec->abs2rel($path, $rprefix); } @@ -2720,7 +2725,7 @@ return $p->{install_path}{$type} if exists $p->{install_path}{$type}; return File::Spec->catdir($p->{install_base}, $self->install_base_relpaths($type)) if $p->{install_base}; - return $self->prefix_relative($type) if $p->{prefix}; + return File::Spec->catdir($p->{prefix}, $self->prefix_relative($type)) if $p->{prefix}; return $p->{install_sets}{ $p->{installdirs} }{$type}; } |
|
From: Michael G S. <sc...@us...> - 2005-06-23 02:54:26
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5253/t Modified Files: tilde.t Log Message: Test that the API does not expand tildes. Index: tilde.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/tilde.t,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- tilde.t 23 Jun 2005 02:35:33 -0000 1.5 +++ tilde.t 23 Jun 2005 02:54:18 -0000 1.6 @@ -5,7 +5,7 @@ use lib 't/lib'; use strict; -use Test::More tests => 9; +use Test::More tests => 10; use TieOut; use Cwd; @@ -63,6 +63,6 @@ $mb = run_sample( ['--destdir=~'] ); is( $mb->destdir, $ENV{HOME} ); + $mb->install_base('~'); + is( $mb->install_base, '~', 'API does not expand tildes' ); } - - |
|
From: Michael G S. <sc...@us...> - 2005-06-23 02:49:52
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2801/t Modified Files: destinations.t Log Message: prefix_relpaths returns arrays, not paths. Index: destinations.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/destinations.t,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- destinations.t 23 Jun 2005 00:27:44 -0000 1.17 +++ destinations.t 23 Jun 2005 02:49:44 -0000 1.18 @@ -131,7 +131,7 @@ foreach my $type (keys %$defaults) { my $prefix = shift @prefixes || [qw(foo bar)]; $test_config{$type} = catdir(File::Spec->rootdir, @$prefix, - $defaults->{$type}); + @{$defaults->{$type}}); } # Poke at the innards of MB to change the default install locations. |
|
From: Michael G S. <sc...@us...> - 2005-06-23 02:45:00
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32384/lib/Module/Build Modified Files: Base.pm Log Message: glob() must be called in list context or else it acts like an iterator and multiple calls to the same glob() can produce unexpected results. Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.442 retrieving revision 1.443 diff -u -d -r1.442 -r1.443 --- Base.pm 23 Jun 2005 02:26:42 -0000 1.442 +++ Base.pm 23 Jun 2005 02:44:52 -0000 1.443 @@ -1273,7 +1273,6 @@ } } - if ($args{makefile_env_macros}) { require Module::Build::Compat; %args = (%args, Module::Build::Compat->makefile_to_build_macros); @@ -1286,7 +1285,9 @@ sub _detildefy { my $arg = shift; - return $arg =~ /^~/ ? glob($arg) : $arg; + ($arg) = $arg =~ /^~/ ? glob($arg) : $arg; + + return $arg; } |
|
From: Michael G S. <sc...@us...> - 2005-06-23 02:35:41
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27535/t Modified Files: tilde.t Log Message: Restructuring to a more flexible setup. Testing destdir. Testing multiple --install_path settings. CURRENTLY FAILING lib is left unset. Investigating. Index: tilde.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/tilde.t,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- tilde.t 23 Jun 2005 02:19:34 -0000 1.4 +++ tilde.t 23 Jun 2005 02:35:33 -0000 1.5 @@ -5,7 +5,7 @@ use lib 't/lib'; use strict; -use Test::More tests => 6; +use Test::More tests => 9; use TieOut; use Cwd; @@ -14,8 +14,8 @@ my $cwd = cwd; -sub test_tilde_expansion { - my($args, $expect) = @_; +sub run_sample { + my($args) = @_; local $Test::Builder::Level = $Test::Builder::Level + 1; @@ -25,26 +25,44 @@ my $mb = Module::Build->current; - my $ret = like( $mb->install_destination('lib'), $expect, - join ' ', @$args - ); - chdir $cwd; - - return $ret; + + return $mb; } + { local $ENV{HOME} = 'home'; - test_tilde_expansion(['--install_base=~'], qr{^$ENV{HOME}} ); - test_tilde_expansion(['--install_base=~/foo'], qr{^$ENV{HOME}/foo} ); - test_tilde_expansion(['--install_base=~~'], qr{^~~} ); - test_tilde_expansion(['--install_base=foo~'], qr{^foo~} ); - test_tilde_expansion(['--prefix=~'], qr{^$ENV{HOME}} ); + my $mb; + + $mb = run_sample( ['--install_base=~']); + is( $mb->install_base, $ENV{HOME} ); + + $mb = run_sample( ['--install_base=~/foo'], qr{^$ENV{HOME}/foo} ); + is( $mb->install_base, "$ENV{HOME}/foo" ); + + $mb = run_sample( ['--install_base=~~'] ); + is( $mb->install_base, '~~' ); + + $mb = run_sample( ['--install_base=foo~'] ); + is( $mb->install_base, 'foo~' ); + + $mb = run_sample( ['--prefix=~'] ); + is( $mb->prefix, $ENV{HOME} ); + + $mb = run_sample( ['--install_path', 'html=~/html', + '--install_path', 'lib=~/lib' + ] ); + is( $mb->install_destination('lib'), "$ENV{HOME}/lib" ); + is( $mb->install_destination('html'), "$ENV{HOME}/html" ); + + $mb = run_sample( ['--install_path', 'lib=~/lib'] ); + is( $mb->install_destination('lib'), "$ENV{HOME}/lib" ); + + $mb = run_sample( ['--destdir=~'] ); + is( $mb->destdir, $ENV{HOME} ); - test_tilde_expansion(['--install_path', 'lib=~/lib'], - qr{^$ENV{HOME}/lib} ); } |
|
From: Ken W. <kwi...@us...> - 2005-06-23 02:26:53
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23299/lib/Module/Build Modified Files: Base.pm Log Message: Let prefix_relative() ask $self for the prefix rather than taking it as an arg Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.441 retrieving revision 1.442 diff -u -d -r1.441 -r1.442 --- Base.pm 23 Jun 2005 02:20:02 -0000 1.441 +++ Base.pm 23 Jun 2005 02:26:42 -0000 1.442 @@ -2639,8 +2639,7 @@ # Translated from ExtUtils::MM_Any::init_INSTALL_from_PREFIX sub prefix_relative { - my ($self, $type, $prefix) = @_; - + my ($self, $type) = @_; my $installdirs = $self->installdirs; my $normal_location = $self->install_sets->{$installdirs}{$type} @@ -2648,7 +2647,7 @@ return $self->_prefixify($normal_location, $self->prefix_sets->{$installdirs}, - $prefix, + $self->prefix, $self->prefix_relpaths($installdirs, $type), ); } @@ -2720,7 +2719,7 @@ return $p->{install_path}{$type} if exists $p->{install_path}{$type}; return File::Spec->catdir($p->{install_base}, $self->install_base_relpaths($type)) if $p->{install_base}; - return $self->prefix_relative($type, $p->{prefix}) if $p->{prefix}; + return $self->prefix_relative($type) if $p->{prefix}; return $p->{install_sets}{ $p->{installdirs} }{$type}; } |
|
From: Michael G S. <sc...@us...> - 2005-06-23 02:20:14
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19034/lib/Module/Build Modified Files: Base.pm Log Message: Functionalize detildefication. Add in code to handle hash parameters, currently only install_path Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.440 retrieving revision 1.441 diff -u -d -r1.440 -r1.441 --- Base.pm 23 Jun 2005 01:54:55 -0000 1.440 +++ Base.pm 23 Jun 2005 02:20:02 -0000 1.441 @@ -1261,8 +1261,18 @@ # De-tilde-ify any path parameters for my $key (qw(prefix install_base destdir)) { next if !defined $args{$key}; - ($args{$key}) = glob($args{$key}) if $args{$key} =~ /^~/; + $args{$key} = _detildefy($args{$key}); + } + + for my $key (qw(install_path)) { + next if !defined $args{$key}; + + for my $subkey (keys %{$args{$key}}) { + next if !defined $args{$key}{$subkey}; + $args{$key}{$subkey} = _detildefy($args{$key}{$subkey}); + } } + if ($args{makefile_env_macros}) { require Module::Build::Compat; @@ -1272,6 +1282,14 @@ return \%args, $action; } + +sub _detildefy { + my $arg = shift; + + return $arg =~ /^~/ ? glob($arg) : $arg; +} + + # merge Module::Build argument lists that have already been parsed # by read_args(). Takes two references to option hashes and merges # the contents, giving priority to the first. |
|
From: Michael G S. <sc...@us...> - 2005-06-23 02:19:45
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18804/t Modified Files: tilde.t Log Message: destdir doesn't effect install_destination so this test doesn't work. Index: tilde.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/tilde.t,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- tilde.t 23 Jun 2005 02:12:01 -0000 1.3 +++ tilde.t 23 Jun 2005 02:19:34 -0000 1.4 @@ -42,7 +42,6 @@ test_tilde_expansion(['--install_base=foo~'], qr{^foo~} ); test_tilde_expansion(['--prefix=~'], qr{^$ENV{HOME}} ); - test_tilde_expansion(['--destdir=~'], qr{^$ENV{HOME}} ); test_tilde_expansion(['--install_path', 'lib=~/lib'], qr{^$ENV{HOME}/lib} ); |
|
From: Michael G S. <sc...@us...> - 2005-06-23 02:12:10
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13544/t Modified Files: tilde.t Log Message: Functionalize the tilde test. Add in tests for various tricky ~ expansions. Add tests for prefix, install_path and destdir. install_path and destdir will currently fail, they are not handled. Index: tilde.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/tilde.t,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- tilde.t 23 Jun 2005 01:54:55 -0000 1.2 +++ tilde.t 23 Jun 2005 02:12:01 -0000 1.3 @@ -2,25 +2,50 @@ # Test ~ expansion from command line arguments. +use lib 't/lib'; use strict; -use Test::More tests => 2; +use Test::More tests => 6; +use TieOut; use Cwd; use File::Spec::Functions qw(catdir); use Module::Build; my $cwd = cwd; -foreach my $param (qw(install_base prefix)) { - local $ENV{HOME} = 'home'; +sub test_tilde_expansion { + my($args, $expect) = @_; + + local $Test::Builder::Level = $Test::Builder::Level + 1; chdir 'Sample'; - Module::Build->run_perl_script('Build.PL', [], ["--$param=~"]); + + Module::Build->run_perl_script('Build.PL', [], [@$args, '--quiet=1']); my $mb = Module::Build->current; - like( $mb->install_destination('lib'), qr/\Q$ENV{HOME}/ ); + my $ret = like( $mb->install_destination('lib'), $expect, + join ' ', @$args + ); chdir $cwd; + + return $ret; } + +{ + local $ENV{HOME} = 'home'; + test_tilde_expansion(['--install_base=~'], qr{^$ENV{HOME}} ); + test_tilde_expansion(['--install_base=~/foo'], qr{^$ENV{HOME}/foo} ); + test_tilde_expansion(['--install_base=~~'], qr{^~~} ); + test_tilde_expansion(['--install_base=foo~'], qr{^foo~} ); + + test_tilde_expansion(['--prefix=~'], qr{^$ENV{HOME}} ); + test_tilde_expansion(['--destdir=~'], qr{^$ENV{HOME}} ); + + test_tilde_expansion(['--install_path', 'lib=~/lib'], + qr{^$ENV{HOME}/lib} ); +} + + |
|
From: Ken W. <kwi...@us...> - 2005-06-23 01:55:04
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4722/t Modified Files: tilde.t Log Message: The string parameters that should be de-tilde-ified are prefix, install_base, and destdir, not prefix, install_base, install_dest (whatever that is) and install_path. We *should* handle install_path too, but it's not a string parameter, it's a hash. Also, in the tests we can't guarantee that the home directory will be at the very start of the installation path. Index: tilde.t =================================================================== RCS file: /cvsroot/module-build/Module-Build/t/tilde.t,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- tilde.t 23 Jun 2005 01:23:55 -0000 1.1 +++ tilde.t 23 Jun 2005 01:54:55 -0000 1.2 @@ -4,7 +4,7 @@ use strict; -use Test::More tests => 1; +use Test::More tests => 2; use Cwd; use File::Spec::Functions qw(catdir); @@ -12,15 +12,15 @@ my $cwd = cwd; -{ +foreach my $param (qw(install_base prefix)) { local $ENV{HOME} = 'home'; chdir 'Sample'; - Module::Build->run_perl_script('Build.PL', [], ['--install_base=~']); + Module::Build->run_perl_script('Build.PL', [], ["--$param=~"]); my $mb = Module::Build->current; - like( $mb->install_destination('lib'), qr/^$ENV{HOME}/ ); + like( $mb->install_destination('lib'), qr/\Q$ENV{HOME}/ ); chdir $cwd; } |
|
From: Ken W. <kwi...@us...> - 2005-06-23 01:55:03
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4722/lib/Module/Build Modified Files: Base.pm Log Message: The string parameters that should be de-tilde-ified are prefix, install_base, and destdir, not prefix, install_base, install_dest (whatever that is) and install_path. We *should* handle install_path too, but it's not a string parameter, it's a hash. Also, in the tests we can't guarantee that the home directory will be at the very start of the installation path. Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.439 retrieving revision 1.440 diff -u -d -r1.439 -r1.440 --- Base.pm 23 Jun 2005 01:46:19 -0000 1.439 +++ Base.pm 23 Jun 2005 01:54:55 -0000 1.440 @@ -1259,7 +1259,7 @@ } # De-tilde-ify any path parameters - for my $key (qw(prefix install_base install_path install_dest)) { + for my $key (qw(prefix install_base destdir)) { next if !defined $args{$key}; ($args{$key}) = glob($args{$key}) if $args{$key} =~ /^~/; } |
|
From: Ken W. <kwi...@us...> - 2005-06-23 01:52:20
|
Update of /cvsroot/module-build/Module-Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4670 Modified Files: MANIFEST Log Message: Index: MANIFEST =================================================================== RCS file: /cvsroot/module-build/Module-Build/MANIFEST,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- MANIFEST 18 Jun 2005 00:33:43 -0000 1.43 +++ MANIFEST 23 Jun 2005 01:52:12 -0000 1.44 @@ -61,6 +61,7 @@ t/Sample/test.foo t/Sample/test.pl t/signature.t +t/tilde.t t/versions.t t/xs.t t/XSTest/Build.PL |
|
From: Ken W. <kwi...@us...> - 2005-06-23 01:46:28
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1702/lib/Module/Build Modified Files: Base.pm Log Message: Apply Schwern's patch to get de-tilde-fication working Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.438 retrieving revision 1.439 diff -u -d -r1.438 -r1.439 --- Base.pm 23 Jun 2005 01:41:31 -0000 1.438 +++ Base.pm 23 Jun 2005 01:46:19 -0000 1.439 @@ -124,12 +124,6 @@ } } - # De-tilde-ify any path parameters - for (qw(prefix install_base install_path install_dest)) { - next unless exists $p->{$_} and defined $p->{$_}; - ($p->{$_}) = glob($p->{$_}) if $p->{$_} =~ /^~/; - } - # The following warning could be unnecessary if the user is running # an embedded perl, but there aren't too many of those around, and # embedded perls aren't usually used to install modules, and the @@ -1263,6 +1257,12 @@ } $args{$_} = \%hash; } + + # De-tilde-ify any path parameters + for my $key (qw(prefix install_base install_path install_dest)) { + next if !defined $args{$key}; + ($args{$key}) = glob($args{$key}) if $args{$key} =~ /^~/; + } if ($args{makefile_env_macros}) { require Module::Build::Compat; |
|
From: Ken W. <kwi...@us...> - 2005-06-23 01:41:41
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31178/lib/Module/Build Modified Files: Base.pm Log Message: little simplification in prefix_relative() Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.437 retrieving revision 1.438 diff -u -d -r1.437 -r1.438 --- Base.pm 23 Jun 2005 00:46:16 -0000 1.437 +++ Base.pm 23 Jun 2005 01:41:31 -0000 1.438 @@ -2625,14 +2625,13 @@ my $installdirs = $self->installdirs; - my $map = $self->install_sets->{$installdirs}; - my $prefix_rel = $self->prefix_relpaths($installdirs, $type); - return unless exists $map->{$type}; + my $normal_location = $self->install_sets->{$installdirs}{$type} + or return; - return $self->_prefixify($map->{$type}, + return $self->_prefixify($normal_location, $self->prefix_sets->{$installdirs}, $prefix, - $prefix_rel + $self->prefix_relpaths($installdirs, $type), ); } |
|
From: Michael G S. <sc...@us...> - 2005-06-23 01:24:09
|
Update of /cvsroot/module-build/Module-Build/t In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21728/t Added Files: tilde.t Log Message: Simple test to see if ~ expansion is working. --- NEW FILE: tilde.t --- #!/usr/bin/perl -w # Test ~ expansion from command line arguments. use strict; use Test::More tests => 1; use Cwd; use File::Spec::Functions qw(catdir); use Module::Build; my $cwd = cwd; { local $ENV{HOME} = 'home'; chdir 'Sample'; Module::Build->run_perl_script('Build.PL', [], ['--install_base=~']); my $mb = Module::Build->current; like( $mb->install_destination('lib'), qr/^$ENV{HOME}/ ); chdir $cwd; } |
|
From: Ken W. <kwi...@us...> - 2005-06-23 00:46:29
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1146/lib/Module/Build Modified Files: Base.pm Log Message: catdir() should do just fine here Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.436 retrieving revision 1.437 diff -u -d -r1.436 -r1.437 --- Base.pm 23 Jun 2005 00:35:14 -0000 1.436 +++ Base.pm 23 Jun 2005 00:46:16 -0000 1.437 @@ -2692,20 +2692,7 @@ $self->log_verbose(" using default '$default'.\n"); - return $self->_catprefix($rprefix, $default); -} - - -# From ExtUtils::MM_VMS::_catprefix(), but it's actually cross platform. -sub _catprefix { - my($self, $rprefix, $default) = @_; - - # The "1" means don't look for a file, $rprefix is a directory. - my($rvol, @rdirs) = File::Spec->splitpath($rprefix, 1); - return File::Spec->catpath($rvol, - File::Spec->catdir(@rdirs, $default), - '' - ); + File::Spec->catdir($rprefix, $default), } |
|
From: Ken W. <kwi...@us...> - 2005-06-23 00:35:23
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27402/lib/Module/Build Modified Files: Base.pm Log Message: Simplify _catprefix() by using the 2-arg form of catpath() Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.435 retrieving revision 1.436 diff -u -d -r1.435 -r1.436 --- Base.pm 23 Jun 2005 00:27:43 -0000 1.435 +++ Base.pm 23 Jun 2005 00:35:14 -0000 1.436 @@ -2700,17 +2700,12 @@ sub _catprefix { my($self, $rprefix, $default) = @_; - # Most file path types do not distinguish between a file and a directory - # so the "file" part here is usually part of the directory. - my($rvol, @rdirs) = File::Spec->splitpath($rprefix); - if( $rvol ) { - return File::Spec->catpath($rvol, - File::Spec->catdir(@rdirs, $default), - '' - ) - } else { - return File::Spec->catdir(@rdirs, $default); - } + # The "1" means don't look for a file, $rprefix is a directory. + my($rvol, @rdirs) = File::Spec->splitpath($rprefix, 1); + return File::Spec->catpath($rvol, + File::Spec->catdir(@rdirs, $default), + '' + ); } |
|
From: Ken W. <kwi...@us...> - 2005-06-23 00:28:22
|
Update of /cvsroot/module-build/Module-Build/t/Sample In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24029/t/Sample Added Files: .cvsignore Log Message: --- NEW FILE: .cvsignore --- META.yml |