diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-04-27 12:58:48 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-04-27 12:58:48 +0000 |
commit | e42bd63e71e4de410a9710993b70c90dd9e75c2e (patch) | |
tree | 134412ad6446d4a15e84049682afe596469dc439 | |
parent | 1b99c731514ee0cc96f061cedd7325b0a94be362 (diff) | |
download | perl-e42bd63e71e4de410a9710993b70c90dd9e75c2e.tar.gz |
Don't bother creating existing directories.
p4raw-id: //depot/perl@9881
-rw-r--r-- | utils/h2xs.PL | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/utils/h2xs.PL b/utils/h2xs.PL index afd86b5215..9c253575f7 100644 --- a/utils/h2xs.PL +++ b/utils/h2xs.PL @@ -664,11 +664,11 @@ else { if( $nested ){ my $modpath = ""; foreach (@modparts){ - mkdir("$modpath$_", 0777); + -d "$modpath$_" || mkdir("$modpath$_", 0777); $modpath .= "$_/"; } } -mkdir($modpname, 0777); +-d "$modpname" || mkdir($modpname, 0777); chdir($modpname) || die "Can't chdir $ext$modpname: $!\n"; my %types_seen; @@ -1844,7 +1844,9 @@ close(RM) || die "Can't close $ext$modpname/README: $!\n"; my $testdir = "t"; my $testfile = "$testdir/1.t"; -mkdir "$testdir" or die "Cannot mkdir $testdir: $!\n"; +unless (-d "$testdir") { + mkdir "$testdir" or die "Cannot mkdir $testdir: $!\n"; +} warn "Writing $ext$modpname/$testfile\n"; open EX, ">$testfile" or die "Can't create $ext$modpname/$testfile: $!\n"; print EX <<'_END_'; |