summaryrefslogtreecommitdiff
path: root/Build/source/texk/texlive/linked_scripts/texlive/fmtutil.pl
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-04-19 21:36:08 +0000
committerKarl Berry <karl@freefriends.org>2016-04-19 21:36:08 +0000
commitadbe3eb411d50490f1c17e55c82e29d63a1ecfe5 (patch)
tree0d7e9190324abe9ee2d3ef2c456c10065651c8bc /Build/source/texk/texlive/linked_scripts/texlive/fmtutil.pl
parented28050639de6674b72251ecd15b4cce0133cb83 (diff)
doc,sync,consistency
git-svn-id: svn://tug.org/texlive/trunk@40622 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/texlive/linked_scripts/texlive/fmtutil.pl')
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/texlive/fmtutil.pl22
1 files changed, 16 insertions, 6 deletions
diff --git a/Build/source/texk/texlive/linked_scripts/texlive/fmtutil.pl b/Build/source/texk/texlive/linked_scripts/texlive/fmtutil.pl
index 05b9022488b..33d72693f4b 100755
--- a/Build/source/texk/texlive/linked_scripts/texlive/fmtutil.pl
+++ b/Build/source/texk/texlive/linked_scripts/texlive/fmtutil.pl
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# $Id: fmtutil.pl 40475 2016-04-12 20:56:58Z karl $
+# $Id: fmtutil.pl 40581 2016-04-17 21:37:08Z siepo $
# fmtutil - utility to maintain format files.
# (Maintained in TeX Live:Master/texmf-dist/scripts/texlive.)
#
@@ -24,11 +24,11 @@ BEGIN {
TeX::Update->import();
}
-my $svnid = '$Id: fmtutil.pl 40475 2016-04-12 20:56:58Z karl $';
-my $lastchdate = '$Date: 2016-04-12 22:56:58 +0200 (Tue, 12 Apr 2016) $';
+my $svnid = '$Id: fmtutil.pl 40581 2016-04-17 21:37:08Z siepo $';
+my $lastchdate = '$Date: 2016-04-17 23:37:08 +0200 (Sun, 17 Apr 2016) $';
$lastchdate =~ s/^\$Date:\s*//;
$lastchdate =~ s/ \(.*$//;
-my $svnrev = '$Revision: 40475 $';
+my $svnrev = '$Revision: 40581 $';
$svnrev =~ s/^\$Revision:\s*//;
$svnrev =~ s/\s*\$$//;
my $version = "r$svnrev ($lastchdate)";
@@ -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;