From: Jarkko Hietaniemi Date: Fri, 27 Apr 2001 12:58:48 +0000 (+0000) Subject: Don't bother creating existing directories. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e42bd63e71e4de410a9710993b70c90dd9e75c2e;p=p5sagit%2Fp5-mst-13.2.git Don't bother creating existing directories. p4raw-id: //depot/perl@9881 --- diff --git a/utils/h2xs.PL b/utils/h2xs.PL index afd86b5..9c25357 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_';