for (readdir DIR) {
next if $_ eq $Curdir || $_ eq $Updir || $_ eq ".exists";
my $targetdir = install_rooted_dir($from_to{$source_dir_or_file});
- if (-w $targetdir ||
- mkpath($targetdir)) {
+ if ($nonono) {
+ if (!-w $targetdir) {
+ print "mkpath($targetdir)\n" if $verbose>1;
+ }
last;
} else {
- warn "Warning: You do not have permissions to " .
- "install into $from_to{$source_dir_or_file}"
- unless $warn_permissions++;
+ if (-w $targetdir ||
+ mkpath($targetdir)) {
+ last;
+ } else {
+ warn "Warning: You do not have permissions to " .
+ "install into $from_to{$source_dir_or_file}"
+ unless $warn_permissions++;
+ }
}
}
closedir DIR;
}
if ($pack{'write'}) {
$dir = install_rooted_dir(dirname($pack{'write'}));
- mkpath($dir,0,0755);
+ mkpath($dir,0,0755) unless $nonono;
print "Writing $pack{'write'}\n";
- $packlist->write(install_rooted_file($pack{'write'}));
+ $packlist->write(install_rooted_file($pack{'write'})) unless $nonono;
}
}
use File::Path;
use File::Spec;
-use Test::More tests => 18;
+use Test::More tests => 21;
BEGIN { use_ok('ExtUtils::Install') }
ok( -r 'blib/lib/auto', ' autosplit still there' );
is( $stdout->read, "Skip blib/lib/Big/Dummy.pm (unchanged)\n" );
+install( { 'blib/lib' => 'install-test/lib/perl',
+ read => 'install-test/packlist',
+ write => 'install-test/packlist'
+ },
+ 0, 1);
+ok( ! -d 'install-test/lib/perl', 'install made dir - dry run' );
+ok( ! -r 'install-test/lib/perl/Big/Dummy.pm', ' .pm file installed - dry run' );
+ok( ! -r 'install-test/packlist', ' packlist exists - dry run' );
install( { 'blib/lib' => 'install-test/lib/perl',
read => 'install-test/packlist',