From 971d104935df8759e33fa311cbd46e6de7c6cee0 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 2 Jun 2010 02:25:04 +0000 Subject: tlmgr.pl: use simpler way to distinguish between value not set or value set to empty string in the texmf.cnf default file git-svn-id: svn://tug.org/texlive/trunk@18694 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf/scripts/texlive/tlmgr.pl | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl index 00044919ede..2f1354d5fd0 100755 --- a/Master/texmf/scripts/texlive/tlmgr.pl +++ b/Master/texmf/scripts/texlive/tlmgr.pl @@ -4080,19 +4080,10 @@ sub action_conf { } else { info("$key not defined in $arg config file\n"); if ($arg eq "texmf") { - # for the case of texmf.cnf we check the default value - # 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) { + chomp (my $defval = `kpsewhich -var-value $key`); + if ($? != 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"); } } -- cgit v1.2.3