summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-11-01 16:56:26 +0000
committerKarl Berry <karl@freefriends.org>2008-11-01 16:56:26 +0000
commit13a92aec8de0a2375d829b20d2a6f0119ed2e295 (patch)
tree5f3124ac16febcc4d086fbcbaec2b35c629d785e
parentdc2fea8b1c807868c2be43828d02062a02bef2f7 (diff)
(mkdirhier): reformatting.
git-svn-id: svn://tug.org/texlive/trunk@11150 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm19
1 files 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";
}
}
}