diff options
Diffstat (limited to 'Master/texmf')
-rwxr-xr-x | Master/texmf/scripts/texlive/tlmgr.pl | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl index 3204c42d9d1..b6521c88779 100755 --- a/Master/texmf/scripts/texlive/tlmgr.pl +++ b/Master/texmf/scripts/texlive/tlmgr.pl @@ -4099,11 +4099,19 @@ sub action_conf { info("$key not defined in $arg config file\n"); if ($arg eq "texmf") { # for the case of texmf.cnf we check the default value - chomp (my $defval = `kpsewhich -var-value $key`); - if (defined($defval)) { - info("Default value for $key is $defval\n"); - } else { + # kpsewhich returns 1 if the value is not set, and 0 if it is + # so to distinguish between a key that is not defined and + # a key that is defined but to the empty string we have to + # call first with system and check the return value, and then + # if the return value is true get the actual value with backticks!! + # what a pain + my $retval = system("kpsewhich -var-value $key >" + . (win32() ? "nul" : "/dev/null")); + if ($retval != 0) { info("No default value for $key is known.\n"); + } else { + chomp (my $defval = `kpsewhich -var-value $key`); + info("Default value for $key is $defval\n"); } } } |