summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-06-03 21:22:07 +0000
committerKarl Berry <karl@freefriends.org>2020-06-03 21:22:07 +0000
commit51fd9695523eae3273b36259411d456341f02a64 (patch)
tree2ac7e8aa79b5d5860e339b4405d84fa255fa7967 /Build
parentca46fdb68d0556867eabb3169853811b944c9d19 (diff)
xindex (3jun20)
git-svn-id: svn://tug.org/texlive/trunk@55401 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/texlive/tlmgr.pl55
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/xindex/xindex.lua38
2 files changed, 78 insertions, 15 deletions
diff --git a/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl b/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
index 9190fa952b8..6aacf95ed31 100755
--- a/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
+++ b/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
@@ -1,12 +1,12 @@
#!/usr/bin/env perl
-# $Id: tlmgr.pl 54766 2020-04-16 11:50:17Z preining $
+# $Id: tlmgr.pl 55369 2020-06-01 00:32:00Z preining $
#
# Copyright 2008-2020 Norbert Preining
# This file is licensed under the GNU General Public License version 2
# or any later version.
-my $svnrev = '$Revision: 54766 $';
-my $datrev = '$Date: 2020-04-16 13:50:17 +0200 (Thu, 16 Apr 2020) $';
+my $svnrev = '$Revision: 55369 $';
+my $datrev = '$Date: 2020-06-01 02:32:00 +0200 (Mon, 01 Jun 2020) $';
my $tlmgrrevision;
my $tlmgrversion;
my $prg;
@@ -25,6 +25,7 @@ our $ismain;
our $loadmediasrcerror;
our $packagelogfile;
our $packagelogged;
+our $commandlogfile;
our $tlmgr_config_file;
our $pinfile;
our $action; # for the pod2usage -sections call
@@ -358,6 +359,7 @@ my %globaloptions = (
"machine-readable" => 1,
"no-execute-actions" => 1,
"package-logfile" => "=s",
+ "command-logfile" => "=s",
"persistent-downloads" => "!",
"pause" => 1,
"pin-file" => "=s",
@@ -653,6 +655,22 @@ for the full story.\n";
debug("appending to package log file: $packagelogfile\n");
}
+ # output of executed commands are put into -command-logfile
+ $commandlogfile = $opts{"command-logfile"};
+ if ($opts{"usermode"}) {
+ $commandlogfile ||= "$::maintree/web2c/tlmgr-commands.log";
+ } else {
+ $commandlogfile ||= "$texmfsysvar/web2c/tlmgr-commands.log";
+ }
+ # Try to open the packagelog file, but do NOT die when that does not work
+ if (!open(COMMANDLOG, ">>$commandlogfile")) {
+ debug("Cannot open command log file for appending: $commandlogfile\n");
+ debug("Will not log output of executed commands for this run\n");
+ $commandlogfile = "";
+ } else {
+ debug("appending to command log file: $commandlogfile\n");
+ }
+
$loadmediasrcerror = "Cannot load TeX Live database from ";
# load the config file and set the config options
@@ -815,7 +833,7 @@ sub do_cmd_and_check {
# tlmgr front ends (MacOSX's TeX Live Utility) can read it
# and show it to the user before the possibly long delay.
info("running $cmd ...\n");
- logpackage("running $cmd");
+ logcommand("running $cmd");
my ($out, $ret);
if ($opts{"dry-run"}) {
$ret = $F_OK;
@@ -829,22 +847,17 @@ sub do_cmd_and_check {
} else {
($out, $ret) = TeXLive::TLUtils::run_cmd("$cmd 2>&1");
}
- # Although it is quite verbose to report all the output from every
- # fmtutil (especially) run, it's the only way to know what's normal
- # when something fails. Prefix each line to make them easy to see
- # (and filter out/in).
- (my $prefixed_out = $out) =~ s/^/(cmd)/gm;
- $prefixed_out =~ s/\n+$//; # trailing newlines don't seem interesting
- my $outmsg = "output:\n$prefixed_out\n--end of output of $cmd.\n";
+ $out =~ s/\n+$//; # trailing newlines don't seem interesting
+ my $outmsg = "output:\n$out\n--end of output of $cmd.\n";
if ($ret == $F_OK) {
info("done running $cmd.\n");
- logpackage("success, $outmsg");
+ logcommand("success, $outmsg");
ddebug("$cmd $outmsg");
return ($F_OK);
} else {
info("\n");
tlwarn("$prg: $cmd failed (status $ret), output:\n$out\n");
- logpackage("error, status: $ret, $outmsg");
+ logcommand("error, status: $ret, $outmsg");
return ($F_ERROR);
}
}
@@ -7457,6 +7470,13 @@ sub logpackage {
print PACKAGELOG "[$tim] @_\n";
}
}
+sub logcommand {
+ if ($commandlogfile) {
+ my $tim = localtime();
+ print COMMANDLOG "[$tim] @_\n";
+ }
+}
+
# resolve relative paths from tlpdb wrt tlroot
sub norm_tlpdb_path {
@@ -7805,6 +7825,13 @@ S<Japanese (ja)>, S<Dutch (nl)>, S<Polish (pl)>, S<Brazilian Portuguese
tlshell shares its message catalog with tlmgr.
+=item B<--command-logfile> I<file>
+
+C<tlmgr> logs the output of all programs invoked (mktexlr, mtxrun, fmtutil,
+updmap) to a separate log file, by default
+C<TEXMFSYSVAR/web2c/tlmgr-commands.log>. This option allows you to specify a
+different file for the log.
+
=item B<--debug-translation>
In GUI mode, this switch tells C<tlmgr> to report any untranslated (or
@@ -10037,7 +10064,7 @@ This script and its documentation were written for the TeX Live
distribution (L<https://tug.org/texlive>) and both are licensed under the
GNU General Public License Version 2 or later.
-$Id: tlmgr.pl 54766 2020-04-16 11:50:17Z preining $
+$Id: tlmgr.pl 55369 2020-06-01 00:32:00Z preining $
=cut
# test HTML version: pod2html --cachedir=/tmp tlmgr.pl >/tmp/tlmgr.html
diff --git a/Build/source/texk/texlive/linked_scripts/xindex/xindex.lua b/Build/source/texk/texlive/linked_scripts/xindex/xindex.lua
index d4316b2949f..2f4654ec136 100755
--- a/Build/source/texk/texlive/linked_scripts/xindex/xindex.lua
+++ b/Build/source/texk/texlive/linked_scripts/xindex/xindex.lua
@@ -8,7 +8,7 @@
-----------------------------------------------------------------------
xindex = xindex or { }
- local version = 0.22
+ local version = 0.23
xindex.version = version
--xindex.self = "xindex"
@@ -49,6 +49,7 @@ local args = require ('xindex-lapp') [[
-o,--output (default "")
-l,--language (default en)
-p,--prefix (default L)
+ -u,--use_UCA
<input> (string)
]]
@@ -174,6 +175,8 @@ escape_chars = { -- by default " is the escape char
{esc_char..')', '//escapedparenright//',')' }
}
+local language = "en" -- default language
+
language = string.lower(args["language"]):sub(1, 2)
writeLog(2,"Language = "..language.."\n",1)
if (indexheader[language] == nil) then
@@ -189,6 +192,39 @@ else
page_folium = folium[language]
end
+use_UCA = args["use_UCA"]
+if use_UCA then
+ writeLog(1,"Will use LUA-UCA\n",1)
+ ducet = require "lua-uca.lua-uca-ducet"
+ collator = require "lua-uca.lua-uca-collator"
+ languages = require "lua-uca.lua-uca-languages"
+ collator_obj = collator.new(ducet)
+
+ local uca_config_file = "xindex-cfg-uca.lua"
+ writeLog(2,"Loading local UCA config file "..uca_config_file,0)
+ UCA_Config_File = kpse.find_file(uca_config_file)
+ uca_cfg = require(UCA_Config_File)
+ writeLog(2," ... done\n",0)
+
+-- language name specified on the command line doesn't seem to be available
+-- in the config file, so we just try to find it ourselves
+ for i, a in ipairs(arg) do
+ if a == "-l" or a=="--language" then
+ language = arg[i+1]
+ break
+ end
+ end
+
+ if languages[language] then
+ print("[Lua-UCA] Loading language: " .. language)
+ collator_obj = languages[language](collator_obj)
+ end
+else
+ writeLog(1,"Will _not_ use LUA-UCA\n",1)
+end
+
+upper = unicode.utf8.upper
+
no_caseSensitive = args["no_casesensitive"]
if no_caseSensitive then
writeLog(1,"Sorting will be no case sensitive\n",1)