From 13a92aec8de0a2375d829b20d2a6f0119ed2e295 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Sat, 1 Nov 2008 16:56:26 +0000 Subject: (mkdirhier): reformatting. git-svn-id: svn://tug.org/texlive/trunk@11150 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/TeXLive/TLUtils.pm | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index 21fce2c430c..e4ac72ff563 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -490,19 +490,20 @@ The optional parameter sets the permission flags. =cut sub mkdirhier { - my $tree=shift; - my $mode=shift; - my $subdir; + my ($tree,$mode) = @_; return if (-d "$tree"); - @dirs=split /\//, $tree; - foreach $dir (@dirs) { - $subdir .= ("$dir" . "/"); - unless (-d $subdir) { + my $subdir = ""; + + @dirs = split (/\//, $tree); + for my $dir (@dirs) { + $subdir .= "$dir/"; + if (! -d $subdir) { if (defined $mode) { - mkdir ($subdir, $mode) || die "mkdir($subdir) failed, goodbye: $!"; + mkdir ($subdir, $mode) + || die "$0: mkdir($subdir,$mode) failed, goodbye: $!\n"; } else { - mkdir ($subdir) || die "mkdir($subdir) failed, goodbye: $!"; + mkdir ($subdir) || die "$0: mkdir($subdir) failed, goodbye: $!\n"; } } } -- cgit v1.2.3