From e42bd63e71e4de410a9710993b70c90dd9e75c2e Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Fri, 27 Apr 2001 12:58:48 +0000 Subject: Don't bother creating existing directories. p4raw-id: //depot/perl@9881 --- utils/h2xs.PL | 8 +++++--- 1 file 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_'; -- cgit v1.2.1