diff options
author | Norbert Preining <preining@logic.at> | 2015-04-15 09:11:32 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2015-04-15 09:11:32 +0000 |
commit | d39fad242a3f0a08baea76e76ec84c8ff61c8532 (patch) | |
tree | d4bb083800420c59c36b520c118b50efc13fc06c | |
parent | ff05aef0836e14dd47dd6748bbfdfe224fdc4c70 (diff) |
don't use make_path from File::Path, not supported in older perls
replace it with mkdirhier from TLUtils
git-svn-id: svn://tug.org/texlive/trunk@36864 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-x | Master/texmf-dist/scripts/texlive/mktexlsr.pl | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/Master/texmf-dist/scripts/texlive/mktexlsr.pl b/Master/texmf-dist/scripts/texlive/mktexlsr.pl index 8cf30a71ad3..9735cd2f445 100755 --- a/Master/texmf-dist/scripts/texlive/mktexlsr.pl +++ b/Master/texmf-dist/scripts/texlive/mktexlsr.pl @@ -443,8 +443,6 @@ sub addfiles { package TeX::Update; -use File::Path qw(make_path); - =pod =head1 TeX ls-R Update module @@ -574,7 +572,7 @@ sub exec { # now do the actual work for my $db (keys %dbs) { if (! -d $db) { - if (! make_path($db) ) { + if (! mktexlsr::mkdirhier($db) ) { die "Cannot create directory $db: $!"; } } @@ -682,6 +680,30 @@ sub win32 { return ( ($^O =~ /^MSWin/i) ? 1 : 0 ); } +# copied from TLUtils.pm +sub mkdirhier { + my ($tree,$mode) = @_; + + return if (-d "$tree"); + my $subdir = ""; + # win32 is special as usual: we need to separate //servername/ part + # from the UNC path, since (! -d //servername/) tests true + $subdir = $& if ( win32() && ($tree =~ s!^//[^/]+/!!) ); + + my @dirs = split (/\//, $tree); + for my $dir (@dirs) { + $subdir .= "$dir/"; + if (! -d $subdir) { + if (defined $mode) { + mkdir ($subdir, $mode) + || die "$0: mkdir($subdir,$mode) failed, goodbye: $!\n"; + } else { + mkdir ($subdir) || die "$0: mkdir($subdir) failed, goodbye: $!\n"; + } + } + } +} + # for module loading! 1; |