diff options
Diffstat (limited to 'Master/texmf/scripts')
-rwxr-xr-x | Master/texmf/scripts/texlive/tlmgr.pl | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl index 0a8fc5de08d..d5c7c7f1f33 100755 --- a/Master/texmf/scripts/texlive/tlmgr.pl +++ b/Master/texmf/scripts/texlive/tlmgr.pl @@ -105,22 +105,6 @@ GetOptions("location=s" => \$opt_location, my $action = shift; -# -# besides doing normal logging if -logfile is specified, we try to log -# package related actions (install, remove, update) to -# the package-log file TEXMFSYSVAR/web2c/tlmgr.log -my $packagelogged = 0; # how many msgs we logged. -my $texmfsysvar = `kpsewhich -var-value=TEXMFSYSVAR`; -chomp($texmfsysvar); -my $packagelogfile ||= "$texmfsysvar/web2c/tlmgr.log"; -# -# Try to open the packagelog file, but do NOT die when that does not work -if (!open(PACKAGELOG, ">>$packagelogfile")) { - debug("Cannot open package log file $packagelogfile for appending\n"); - debug("Will not log package installation/removal/update for that run\n"); - $packagelogfile = ""; -} - if (!defined($action) && $opt_gui) { $action = "gui"; } @@ -146,10 +130,29 @@ if (!defined($action) && !$opt_help) { die "$0: missing action; try --help if you need it.\n"; } -if ($^O =~ /^MSWin(32|64)$/i) { - pod2usage(-exitstatus => 0, -verbose => 2, -noperldoc => 1) if $opt_help; -} else { - pod2usage(-exitstatus => 0, -verbose => 2) if $opt_help; +# Often Windows will not have perldoc, but some Unix-based +# installations may lack it also. We want to use it if we have it, to +# get ASCII emphasis. +if ($opt_help) { + if (TeXLive::TLUtils::which("perldoc")) { + pod2usage(-exitstatus => 0, -verbose => 2); + } else { + pod2usage(-exitstatus => 0, -verbose => 2, -noperldoc => 1); + } +} + +# besides doing normal logging if -logfile is specified, we try to log +# package related actions (install, remove, update) to +# the package-log file TEXMFSYSVAR/web2c/tlmgr.log +my $packagelogged = 0; # how many msgs we logged +chomp (my $texmfsysvar = `kpsewhich -var-value=TEXMFSYSVAR`); +my $packagelogfile ||= "$texmfsysvar/web2c/tlmgr.log"; +# +# Try to open the packagelog file, but do NOT die when that does not work +if (!open(PACKAGELOG, ">>$packagelogfile")) { + debug("Cannot open package log file $packagelogfile for appending\n"); + debug("Will not log package installation/removal/update for that run\n"); + $packagelogfile = ""; } my $loadmediasrcerror = "Cannot load TeX Live database from "; |