summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/texlive/tlmgr.pl
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/scripts/texlive/tlmgr.pl')
-rwxr-xr-xMaster/texmf-dist/scripts/texlive/tlmgr.pl77
1 files changed, 10 insertions, 67 deletions
diff --git a/Master/texmf-dist/scripts/texlive/tlmgr.pl b/Master/texmf-dist/scripts/texlive/tlmgr.pl
index 55350a58316..78221b0616d 100755
--- a/Master/texmf-dist/scripts/texlive/tlmgr.pl
+++ b/Master/texmf-dist/scripts/texlive/tlmgr.pl
@@ -24,7 +24,6 @@ our $Master;
our $loadmediasrcerror;
our $packagelogfile;
our $packagelogged;
-our $commandslogged;
our $commandlogfile;
our $tlmgr_config_file;
our $pinfile;
@@ -633,7 +632,6 @@ for the full story.\n";
# package related actions (install, remove, update) to
# the package-log file TEXMFSYSVAR/web2c/tlmgr.log
$packagelogged = 0; # how many msgs we logged
- $commandslogged = 0;
chomp (my $texmfsysvar = `kpsewhich -var-value=TEXMFSYSVAR`);
$packagelogfile = $opts{"package-logfile"};
if ($opts{"usermode"}) {
@@ -701,15 +699,9 @@ for the full story.\n";
my $ret = execute_action($action, @ARGV);
# close the special log file
- if (!$::gui_mode) {
- if ($packagelogfile) {
- info("$prg: package log updated: $packagelogfile\n") if $packagelogged;
- close(PACKAGELOG);
- }
- if ($commandlogfile) {
- info("$prg: command log updated: $commandlogfile\n") if $commandslogged;
- close(COMMANDLOG);
- }
+ if ($packagelogfile && !$::gui_mode) {
+ info("$prg: package log updated: $packagelogfile\n") if $packagelogged;
+ close(PACKAGELOG);
}
# F_ERROR stops processing immediately, and prevents postactions from
@@ -836,7 +828,6 @@ sub do_cmd_and_check {
# and show it to the user before the possibly long delay.
info("running $cmd ...\n");
logcommand("running $cmd");
- logpackage("command: $cmd");
my ($out, $ret);
if ($opts{"dry-run"}) {
$ret = $F_OK;
@@ -876,15 +867,12 @@ sub handle_execute_actions {
my $errors = 0;
my $sysmode = ($opts{"usermode"} ? "-user" : "-sys");
- my $fmtutil_cmd = "fmtutil$sysmode";
- my $status_file = TeXLive::TLUtils::tl_tmpfile();
- my $fmtutil_args = "$common_fmtutil_args --status-file=$status_file";
-
+ my $invoke_fmtutil = "fmtutil$sysmode $common_fmtutil_args";
# of create_formats is unset (NOT the default) we add --refresh so that
# only existing formats are recreated
if (!$localtlpdb->option("create_formats")) {
- $fmtutil_args .= " --refresh";
+ $invoke_fmtutil .= " --refresh";
debug("only existing formats will be refreshed per user option (create_formats=0)\n");
}
@@ -985,9 +973,7 @@ sub handle_execute_actions {
for my $e (keys %updated_engines) {
debug ("updating formats based on $e\n");
$errors += do_cmd_and_check
- ("$fmtutil_cmd --byengine $e --no-error-if-no-format $fmtutil_args");
- read_and_report_fmtutil_status_file($status_file);
- unlink($status_file);
+ ("$invoke_fmtutil --no-error-if-no-format --byengine $e");
}
# now rebuild all other formats
for my $f (keys %do_enable) {
@@ -995,9 +981,7 @@ sub handle_execute_actions {
# ignore disabled formats
next if !$::execute_actions{'enable'}{'formats'}{$f}{'mode'};
debug ("(re)creating format dump $f\n");
- $errors += do_cmd_and_check ("$fmtutil_cmd --byfmt $f $fmtutil_args");
- read_and_report_fmtutil_status_file($status_file);
- unlink($status_file);
+ $errors += do_cmd_and_check ("$invoke_fmtutil --byfmt $f");
$done_formats{$f} = 1;
}
}
@@ -1016,9 +1000,7 @@ sub handle_execute_actions {
$lang = "$TEXMFSYSVAR/tex/generic/config/$lang";
}
if (!$::regenerate_all_formats) {
- $errors += do_cmd_and_check ("$fmtutil_cmd --byhyphen \"$lang\" $fmtutil_args");
- read_and_report_fmtutil_status_file($status_file);
- unlink($status_file);
+ $errors += do_cmd_and_check ("$invoke_fmtutil --byhyphen \"$lang\"");
}
}
}
@@ -1027,10 +1009,8 @@ sub handle_execute_actions {
# so we just refresh formats instead of generating all that have not been there
if ($::regenerate_all_formats) {
info("Regenerating available formats, this may take some time ...");
- # --refresh might already be in $fmtutil_args, but we don't care
- $errors += do_cmd_and_check("$fmtutil_cmd --all --refresh $fmtutil_args");
- read_and_report_fmtutil_status_file($status_file);
- unlink($status_file);
+ # --refresh might already be in $invoke_fmtutil, but we don't care
+ $errors += do_cmd_and_check("$invoke_fmtutil --refresh --all");
info("done\n");
$::regenerate_all_formats = 0;
}
@@ -1048,42 +1028,6 @@ sub handle_execute_actions {
}
}
-sub read_and_report_fmtutil_status_file {
- my $status_file = shift;
- my $fh;
- if (!open($fh, '<', $status_file)) {
- printf STDERR "Cannot read status file $status_file, strange!\n";
- return;
- }
- chomp(my @lines = <$fh>);
- close $fh;
- my @failed;
- my @success;
- for my $l (@lines) {
- my ($status, $fmt, $eng, $what, $whatargs) = split(' ', $l, 5);
- if ($status eq "DISABLED") {
- # ignore for now
- } elsif ($status eq "NOTSELECTED") {
- # ignore for now
- } elsif ($status eq "FAILURE") {
- push @failed, "${fmt}.fmt/$eng";
- } elsif ($status eq "SUCCESS") {
- push @success, "${fmt}.fmt/$eng";
- } elsif ($status eq "NOTAVAIL") {
- # ignore for now
- } elsif ($status eq "UNKNOWN") {
- # ignore for now
- } else {
- # ignore for now
- }
- }
- logpackage(" OK: @success") if (@success);
- logpackage(" ERROR: @failed") if (@failed);
- logcommand(" OK: @success") if (@success);
- logcommand(" ERROR: @failed") if (@failed);
- info(" OK: @success\n") if (@success);
- info(" ERROR: @failed\n") if (@failed);
-}
# GET_MIRROR
#
@@ -7566,7 +7510,6 @@ sub logpackage {
}
sub logcommand {
if ($commandlogfile) {
- $commandslogged++;
my $tim = localtime();
print COMMANDLOG "[$tim] @_\n";
}