From: Graham Knop Date: Wed, 30 Oct 2013 01:14:57 +0000 (-0400) Subject: fix install script on cygwin X-Git-Tag: 1.008025~8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fc1885f9367ef074108cea211d1f5b15b93e454a;p=p5sagit%2Flocal-lib.git fix install script on cygwin --- diff --git a/.gitignore b/.gitignore index 3e0921a..0794ba9 100644 --- a/.gitignore +++ b/.gitignore @@ -21,12 +21,4 @@ /todo.txt /todo/ /inc/ -/t/dist/EUMM/MYMETA.* -/t/dist/EUMM/Makefile -/t/dist/EUMM/blib/ -/t/dist/EUMM/pm_to_blib -/t/dist/MB/Build -/t/dist/MB/Build.bat -/t/dist/MB/_build/ -/t/dist/MB/blib/ /t/temp/ diff --git a/t/dist/EUMM/Makefile.PL b/t/dist/EUMM/Makefile.PL deleted file mode 100644 index 09cc2b9..0000000 --- a/t/dist/EUMM/Makefile.PL +++ /dev/null @@ -1,5 +0,0 @@ -use ExtUtils::MakeMaker; - -WriteMakefile( - NAME => 'EUMM', -); diff --git a/t/dist/EUMM/lib/EUMM.pm b/t/dist/EUMM/lib/EUMM.pm deleted file mode 100644 index 0afc604..0000000 --- a/t/dist/EUMM/lib/EUMM.pm +++ /dev/null @@ -1 +0,0 @@ -1; diff --git a/t/dist/MB/Build.PL b/t/dist/MB/Build.PL deleted file mode 100644 index 1b2aeb3..0000000 --- a/t/dist/MB/Build.PL +++ /dev/null @@ -1,6 +0,0 @@ -use Module::Build; -Module::Build->new( - module_name => "MB", - dist_version => 1, - license => "perl", -)->create_build_script; diff --git a/t/dist/MB/lib/MB.pm b/t/dist/MB/lib/MB.pm deleted file mode 100644 index 8c80ba2..0000000 --- a/t/dist/MB/lib/MB.pm +++ /dev/null @@ -1 +0,0 @@ -our $VERSION = 1; 1; diff --git a/t/install.t b/t/install.t index 874e3e1..70e86f4 100644 --- a/t/install.t +++ b/t/install.t @@ -22,10 +22,23 @@ my @dirs = ( my %dist_types = ( EUMM => sub { + open my $fh, '>', 'Makefile.PL' or die "can't create Makefile.PL: $!"; + print $fh 'use ExtUtils::MakeMaker; WriteMakefile( NAME => "EUMM" );'; + close $fh; system($^X, 'Makefile.PL') && die "Makefile.PL failed"; system($Config{make}, 'install') && die "$Config{make} install failed"; }, MB => sub { + open my $fh, '>', 'Build.PL' or die "can't create Build.PL: $!"; + print $fh <new( + module_name => "MB", + dist_version => 1, + license => "perl", +)->create_build_script; +END_BUILD + close $fh; system($^X, 'Build.PL') && die "Build.PL failed"; system($^X, 'Build', 'install') && die "Build install failed"; }, @@ -37,12 +50,20 @@ my $orig_dir = cwd; for my $dir_base (@dirs) { for my $dist_type (sort keys %dist_types) { chdir $orig_dir; - my $temp = mk_temp_dir('test_local_lib-XXXXX'); + my $temp = mk_temp_dir("install-$dist_type-XXXXX"); my $ll_dir = "$dist_type-$dir_base"; - mkpath(my $ll = "$temp/$ll_dir"); + my $ll = "$temp/$ll_dir"; + mkpath(File::Spec->canonpath($ll)); + local::lib->import($ll); - chdir File::Spec->catdir($orig_dir, qw(t dist), $dist_type); + my $dist_dir = mk_temp_dir("source-$dist_type-XXXXX"); + chdir $dist_dir; + mkdir 'lib'; + open my $fh, '>', "lib/$dist_type.pm"; + print $fh '1;'; + close $fh; + my $output = capture_merged { eval { $dist_types{$dist_type}->(); } };