summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Build/source/texk/tests/TeXLive/TLUtils.pm105
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/texlive/tlmgr.pl24
-rw-r--r--Build/source/texk/texlive/tl_scripts/fmtutil.cnf14
-rwxr-xr-xBuild/source/texk/texlive/w32_wrapper/runscript.tlu22
4 files changed, 114 insertions, 51 deletions
diff --git a/Build/source/texk/tests/TeXLive/TLUtils.pm b/Build/source/texk/tests/TeXLive/TLUtils.pm
index 432011f09e0..ce56842e4ad 100644
--- a/Build/source/texk/tests/TeXLive/TLUtils.pm
+++ b/Build/source/texk/tests/TeXLive/TLUtils.pm
@@ -5,7 +5,7 @@
package TeXLive::TLUtils;
-my $svnrev = '$Revision: 40652 $';
+my $svnrev = '$Revision: 41175 $';
my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown";
sub module_revision { return $_modulerevision; }
@@ -31,8 +31,9 @@ C<TeXLive::TLUtils> -- utilities used in TeX Live infrastructure
TeXLive::TLUtils::getenv($string);
TeXLive::TLUtils::which($string);
- TeXLive::TLUtils::get_system_tmpdir();
+ TeXLive::TLUtils::initialize_global_tmpdir();
TeXLive::TLUtils::tl_tmpdir();
+ TeXLive::TLUtils::tl_tmpfile();
TeXLive::TLUtils::xchdir($dir);
TeXLive::TLUtils::wsystem($msg,@args);
TeXLive::TLUtils::xsystem(@args);
@@ -123,7 +124,7 @@ BEGIN {
&unix
&getenv
&which
- &get_system_tmpdir
+ &initialize_global_tmpdir
&dirname
&basename
&dirname_and_basename
@@ -190,6 +191,7 @@ BEGIN {
use Cwd;
use Getopt::Long;
use File::Temp;
+use File::Copy qw//;
use TeXLive::TLConfig;
@@ -453,20 +455,17 @@ sub which {
return 0;
}
-=item C<get_system_tmpdir>
+=item C<initialize_global_tmpdir();>
-Evaluate the environment variables C<TMPDIR>, C<TMP>, and C<TEMP> in
-order to find the system temporary directory.
+Initializes a directory for all temporary files. This uses C<File::Temp>
+and thus honors various env variables like C<TMPDIR>, C<TMP>, and C<TEMP>.
=cut
-sub get_system_tmpdir {
- my $systmp=0;
- $systmp||=getenv 'TMPDIR';
- $systmp||=getenv 'TMP';
- $systmp||=getenv 'TEMP';
- $systmp||='/tmp';
- return "$systmp";
+sub initialize_global_tmpdir {
+ $::tl_tmpdir = File::Temp::tempdir(CLEANUP => 1);
+ debug("tl_tempdir: creating global tempdir $::tl_tmpdir\n");
+ return ($::tl_tmpdir);
}
=item C<tl_tmpdir>
@@ -477,9 +476,28 @@ is terminated.
=cut
sub tl_tmpdir {
- return (File::Temp::tempdir(CLEANUP => 1));
+ initialize_global_tmpdir() if (!defined($::tl_tmpdir));
+ my $tmp = File::Temp::tempdir(DIR => $::tl_tmpdir, CLEANUP => 1);
+ debug("tl_tempdir: creating tempdir $tmp\n");
+ return ($tmp);
}
+=item C<tl_tmpfile>
+
+Create a temporary file which is removed when the program
+is terminated. Returns file handle and file name.
+Arguments are passed on to C<File::Temp::tempfile>.
+
+=cut
+
+sub tl_tmpfile {
+ initialize_global_tmpdir() if (!defined($::tl_tmpdir));
+ my ($fh, $fn) = File::Temp::tempfile(@_, DIR => $::tl_tmpdir, UNLINK => 1);
+ debug("tl_tempfile: creating tempfile $fn\n");
+ return ($fh, $fn);
+}
+
+
=item C<xchdir($dir)>
C<chdir($dir)> or die.
@@ -1337,9 +1355,10 @@ sub install_packages {
foreach my $h (@::install_packages_hook) {
&$h($n,$totalnr);
}
- # TODO TODO
- # we do NOT check the return value!!!
- $fromtlpdb->install_package($package, $totlpdb);
+ # return false if something went wrong
+ if (!$fromtlpdb->install_package($package, $totlpdb)) {
+ return 0;
+ }
$donesize += $tlpsizes{$package};
}
my $totaltime = time() - $starttime;
@@ -1954,7 +1973,8 @@ not agree. If a check argument is not given, that check is not performed.
sub check_file {
my ($xzfile, $checksum, $checksize) = @_;
- if ($checksum) {
+ # only run checksum tests if we can actually compute the checksum
+ if ($checksum && $::checksum_method) {
my $tlchecksum = TeXLive::TLCrypto::tlchecksum($xzfile);
if ($tlchecksum ne $checksum) {
tlwarn("TLUtils::check_file: removing $xzfile, checksums differ:\n");
@@ -2042,7 +2062,9 @@ sub unpack {
# if the file is now not present, we can use it
if (! -r $xzfile) {
# try download the file and put it into temp
- download_file($what, $xzfile);
+ if (!download_file($what, $xzfile)) {
+ return(0, "downloading did not succeed");
+ }
# remove false downloads
check_file($xzfile, $checksum, $size);
if ( ! -r $xzfile ) {
@@ -2365,6 +2387,13 @@ sub download_file {
tlwarn ("download_file: Programs not set up, trying literal wget\n");
$wget = "wget";
}
+ #
+ # create output dir if necessary
+ my $par;
+ if ($dest ne "|") {
+ $par = dirname($dest);
+ mkdirhier ($par) unless -d "$par";
+ }
my $url;
if ($relpath =~ m;^file://*(.*)$;) {
my $filetoopen = "/$1";
@@ -2375,7 +2404,6 @@ sub download_file {
# opening to a pipe always succeeds, so we return immediately
return \*RETFH;
} else {
- my $par = dirname ($dest);
if (-r $filetoopen) {
copy ($filetoopen, $par);
return 1;
@@ -2625,7 +2653,7 @@ sub check_for_old_updmap_cfg {
my $nn = "$oldupd.DISABLED";
if (-r $nn) {
my $fh;
- ($fh, $nn) = File::Temp::tempfile(
+ ($fh, $nn) = tl_tmpfile(
"updmap.cfg.DISABLED.XXXXXX", DIR => "$tmfsysconf/web2c");
}
print "Renaming old config file from
@@ -2725,6 +2753,7 @@ sub _create_config_files {
$tlpdblinesref, @postlines) = @_;
my $root = $tlpdb->root;
my @lines = ();
+ my $usermode = $tlpdb->setting( "usertree" );
if (-r "$root/$headfile") {
# we might be in user mode and do *not* want that the generation
# of the configuration file just boils out.
@@ -2733,11 +2762,7 @@ sub _create_config_files {
@lines = <INFILE>;
close (INFILE);
} else {
- tlwarn("TLUtils::_create_config_files: $root/$headfile missing!\n");
- # TODO
- # if we allow tlmgr generate to generate language.* file in usermode
- # we need to remove the die here!
- die ("Giving up.");
+ die ("Giving up.") if (!$usermode);
}
push @lines, @$tlpdblinesref;
if (defined($localconf) && -r $localconf) {
@@ -2753,17 +2778,19 @@ sub _create_config_files {
if (@postlines) {
push @lines, @postlines;
}
- if ($#lines >= 0) {
- open(OUTFILE,">$dest")
- or die("Cannot open $dest for writing: $!");
+ if ($usermode && -e $dest) {
+ tlwarn("Updating $dest, backup copy in $dest.backup\n");
+ File::Copy::copy($dest, "$dest.backup");
+ }
+ open(OUTFILE,">$dest")
+ or die("Cannot open $dest for writing: $!");
- if (!$keepfirstline) {
- print OUTFILE $cc;
- printf OUTFILE " Generated by %s on %s\n", "$0", scalar localtime;
- }
- print OUTFILE @lines;
- close(OUTFILE) || warn "close(>$dest) failed: $!";
+ if (!$keepfirstline) {
+ print OUTFILE $cc;
+ printf OUTFILE " Generated by %s on %s\n", "$0", scalar localtime;
}
+ print OUTFILE @lines;
+ close(OUTFILE) || warn "close(>$dest) failed: $!";
}
sub parse_AddHyphen_line {
@@ -3180,7 +3207,11 @@ Uses C<tlwarn> to issue a warning, then exits with exit code 1.
sub tldie {
tlwarn(@_);
- exit(1);
+ if ($::gui_mode) {
+ Tk::exit(1);
+ } else {
+ exit(1);
+ }
}
=item C<debug_hash ($label, hash))>
@@ -3610,7 +3641,7 @@ sub download_to_temp_or_file {
my $url = shift;
my ($url_fh, $url_file);
if ($url =~ m,^(http|ftp|file)://,) {
- ($url_fh, $url_file) = File::Temp::tempfile(UNLINK => 1);
+ ($url_fh, $url_file) = tl_tmpfile();
# now $url_fh filehandle is open, the file created
# TLUtils::download_file will just overwrite what is there
# on windows that doesn't work, so we close the fh immediately
diff --git a/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl b/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
index 7172abf7ca1..cf85ba1c053 100755
--- a/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
+++ b/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
@@ -1,13 +1,13 @@
#!/usr/bin/env perl
-# $Id: tlmgr.pl 41175 2016-05-16 00:33:33Z preining $
+# $Id: tlmgr.pl 41187 2016-05-16 14:04:50Z preining $
#
# Copyright 2008-2016 Norbert Preining
# This file is licensed under the GNU General Public License version 2
# or any later version.
#
-my $svnrev = '$Revision: 41175 $';
-my $datrev = '$Date: 2016-05-16 02:33:33 +0200 (Mon, 16 May 2016) $';
+my $svnrev = '$Revision: 41187 $';
+my $datrev = '$Date: 2016-05-16 16:04:50 +0200 (Mon, 16 May 2016) $';
my $tlmgrrevision;
my $prg;
if ($svnrev =~ m/: ([0-9]+) /) {
@@ -187,7 +187,23 @@ my %action_specification = (
"function" => \&action_get_mirror
},
"gui" => {
- "options" => { "load" => 1 },
+ "options" => {
+ "load" => 1,
+ # Tk::CmdLine options
+ "font" => "=s",
+ "background" => "=s",
+ "class" => "=s",
+ "display" => "=s",
+ "screen" => "=s",
+ "foreground" => "=s",
+ "geometry" => "=s",
+ "name" => "=s",
+ "title" => "=s",
+ "xrm" => "=s",
+ "iconic" => 1,
+ "motif" => 1,
+ "synchronous" => 1,
+ },
"run-post" => 1,
"function" => \&action_gui
},
diff --git a/Build/source/texk/texlive/tl_scripts/fmtutil.cnf b/Build/source/texk/texlive/tl_scripts/fmtutil.cnf
index 885096479d7..d382bc94f80 100644
--- a/Build/source/texk/texlive/tl_scripts/fmtutil.cnf
+++ b/Build/source/texk/texlive/tl_scripts/fmtutil.cnf
@@ -1,4 +1,4 @@
-# Generated by /home/texlive/karl/Master/bin/i386-linux/tlmgr on Tue Apr 19 03:16:09 2016
+# Generated by /home/texlive/karl/Master/bin/i386-linux/tlmgr on Sun May 15 03:17:09 2016
# Originally written by Thomas Esser, 1998. Public domain.
#
# As of TeX Live 2015, fmtutil reads *all* fmtutil.cnf files found.
@@ -76,9 +76,7 @@ lualatex luatex language.dat,language.dat.lua lualatex.ini
#! luajitlatex luajittex language.dat,language.dat.lua lualatex.ini
#
# from lollipop:
-lollipop pdftex - -translate-file=cp227.tcx *lollipop.ini
-lualollipop luatex - lualollipop.ini
-xelollipop xetex - -etex xelollipop.ini
+lollipop tex - lollipop.ini
#
# from luatex:
luatex luatex language.def,language.dat.lua luatex.ini
@@ -108,10 +106,12 @@ pdftex pdftex language.def -translate-file=cp227.tcx *pdfetex.ini
etex pdftex language.def -translate-file=cp227.tcx *etex.ini
pdfetex pdftex language.def -translate-file=cp227.tcx *pdfetex.ini
#
+# from platex:
+platex eptex language.dat *platex.ini
+#
# from ptex:
ptex ptex - ptex.ini
eptex eptex language.def *eptex.ini
-platex eptex language.dat *platex.ini
#
# from tex:
tex tex - tex.ini
@@ -119,10 +119,12 @@ tex tex - tex.ini
# from texsis:
texsis pdftex - -translate-file=cp227.tcx texsis.ini
#
+# from uplatex:
+uplatex euptex language.dat *uplatex.ini
+#
# from uptex:
uptex uptex - uptex.ini
euptex euptex language.def *euptex.ini
-uplatex euptex language.dat *uplatex.ini
#
# from xetex:
xetex xetex language.def -etex xetex.ini
diff --git a/Build/source/texk/texlive/w32_wrapper/runscript.tlu b/Build/source/texk/texlive/w32_wrapper/runscript.tlu
index 53deaf07125..bd67db241c7 100755
--- a/Build/source/texk/texlive/w32_wrapper/runscript.tlu
+++ b/Build/source/texk/texlive/w32_wrapper/runscript.tlu
@@ -1,7 +1,7 @@
-local svnrevision = string.match("$Revision: 39067 $", "%d+") or "0"
-local svndate = string.match("$Date: 2015-12-10 23:28:26 +0100 (Thu, 10 Dec 2015) $", "[-%d]+") or "2009-12-04"
+local svnrevision = string.match("$Revision: 40700 $", "%d+") or "0"
+local svndate = string.match("$Date: 2016-04-23 14:35:18 +0200 (Sat, 23 Apr 2016) $", "[-%d]+") or "2009-12-04"
local bannerstr = "runscript wrapper utility (rev. " ..
svnrevision .. ", " .. svndate .. ")\n" ..
"usage: runscript script-name [arguments]\n" ..
@@ -253,6 +253,8 @@ local docstr = [[
- more slash flipping for the sake of vbscript and unc paths
2015/12/11
- fix spurious arguments for updmap and fmtutil
+ 2016/04/22
+ - Warning if external perl is requested but missing
]]
-- HELPER SUBROUTINES --
@@ -471,7 +473,15 @@ local scripts4tlperl = {
local try_extern_perl = (kpse.var_value('TEXLIVE_WINDOWS_TRY_EXTERNAL_PERL') == '1') and
not (guimode or is_restricted_progname or scripts4tlperl[progname])
local PERLEXE = try_extern_perl and search_path('perl.exe', PATH)
-if not PERLEXE then
+local extperl_warn
+if not PERLEXE then
+ if try_extern_perl then extperl_warn = [[
+External Perl missing or outdated. Please install a recent Perl, or configure
+TeX Live to always use the builtin Perl:
+ tlmgr conf texmf TEXLIVE_WINDOWS_TRY_EXTERNAL_PERL 0
+Meanwhile, continuing with built-in Perl...
+]]
+ end -- if try_extern_perl
PERLEXE = TEXDIR..'/tlpkg/tlperl/bin/perl.exe'
os.setenv('PERL5LIB', TEXDIR..'/tlpkg/tlperl/lib')
PATH = prepend_path(PATH, TEXDIR..'/tlpkg/tlperl/bin')
@@ -662,6 +672,10 @@ end
if ARGV then
table.insert(ARGV, argline) -- pass through original arguments
+ if string.find (table.concat(ARGV, ' '), 'perl.exe') and extperl_warn then
+
+ io.stderr:write(extperl_warn)
+ end
local ret = assert(os.spawn(ARGV))
if ret ~= 0 then
local dbginfo = debug.getinfo(1)
@@ -687,6 +701,6 @@ if not success then
end
-- about RUNSCRIPT_ERROR_MESSAGE environment variable:
--- it stores an error message that is catched and displayed
+-- it stores an error message that is caught and displayed
-- in a message box on the C side at process exit
-- (currently used only by gui mode stubs)