summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xMaster/texmf-dist/scripts/texlive/fmtutil.pl14
1 files changed, 12 insertions, 2 deletions
diff --git a/Master/texmf-dist/scripts/texlive/fmtutil.pl b/Master/texmf-dist/scripts/texlive/fmtutil.pl
index 76005cf1211..6aeaf0fc8cc 100755
--- a/Master/texmf-dist/scripts/texlive/fmtutil.pl
+++ b/Master/texmf-dist/scripts/texlive/fmtutil.pl
@@ -37,6 +37,7 @@ use strict;
use Getopt::Long qw(:config no_autoabbrev ignore_case_always);
use File::Basename;
use File::Copy;
+use File::Spec;
use Cwd;
# don't import anything automatically, this requires us to explicitly
@@ -44,6 +45,8 @@ use Cwd;
# find and if necessary remove references to TLUtils
use TeXLive::TLUtils qw();
+require TeXLive::TLWinGoo if TeXLive::TLUtils::win32;
+
# numerical constants
my $FMT_NOTSELECTED = 0;
my $FMT_DISABLED = 1;
@@ -321,8 +324,11 @@ sub callback_build_formats {
my $tmpdir;
if (win32()) {
my $foo;
+ my $tmp_deflt = File::Spec->tmpdir;
for my $i (1..5) {
- $foo = "$texmfvar/temp.$$." . int(rand(1000000));
+ # $foo = "$texmfvar/temp.$$." . int(rand(1000000));
+ $foo = (($texmfvar =~ m!^//!) ? $tmp_deflt : $texmfvar)
+ . "/temp.$$." . int(rand(1000000));
if (! -d $foo) {
if (mkdir($foo)) {
$tmpdir = $foo;
@@ -333,6 +339,10 @@ sub callback_build_formats {
if (! $tmpdir) {
die "Cannot get a temporary directory after five iterations ... sorry!";
}
+ if ($texmfvar =~ m!^//!) {
+ # used File::Spec->tmpdir; fix permissions
+ TeXLive::TLWinGoo::maybe_make_ro ($tmpdir);
+ }
} else {
$tmpdir = File::Temp::tempdir(CLEANUP => 1);
}
@@ -349,7 +359,7 @@ sub callback_build_formats {
# for safety, check again
die "abs_path failed, strange: $!" if !$opts{'fmtdir'};
print_info("writing formats under $opts{fmtdir}\n"); # report
-
+
# code taken over from the original shell script for KPSE_DOT etc
my $thisdir = cwd();
$ENV{'KPSE_DOT'} = $thisdir;