diff options
author | Karl Berry <karl@freefriends.org> | 2008-11-01 17:15:20 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2008-11-01 17:15:20 +0000 |
commit | f3d1051cb6e1efc35786eec5bc6d5324d6924a8d (patch) | |
tree | 9d7480fbd801d75101c831a894dbc58a933dd740 /Master/texmf | |
parent | 13a92aec8de0a2375d829b20d2a6f0119ed2e295 (diff) |
tlmgr.pl: check for perldoc being present, instead of just for windows.
TLUtils.pm (program_exists): delete, it is not used anywhere that I can
see and the documentation was wrong.
(which): reformat.
git-svn-id: svn://tug.org/texlive/trunk@11151 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf')
-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 "; |