diff options
author | Norbert Preining <preining@logic.at> | 2010-05-29 15:35:39 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2010-05-29 15:35:39 +0000 |
commit | eb5dc4a821a080501b8b788ee6d42a822b81de32 (patch) | |
tree | 7bae0d38ba4c25be28602349c227f3e461b4227e /Master/texmf/scripts | |
parent | 8b9e6e96cae0f776985823228bcd42676ecb332f (diff) |
deal with not-0 return value of kpsewhich -var-value for not defined keys
git-svn-id: svn://tug.org/texlive/trunk@18585 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf/scripts')
-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"); } } } |