summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2010-05-28 05:03:56 +0000
committerNorbert Preining <preining@logic.at>2010-05-28 05:03:56 +0000
commit8745ea9056cb2e68717bec2b56317ab67992a23b (patch)
treeab2a7e79b1f0adc07bafb6bd705217d2512b91c5
parent6338c3fe69f2e3d729d40494a11f5cf4eea59d55 (diff)
allow to edit/create not existing conf file which will be created
on the go git-svn-id: svn://tug.org/texlive/trunk@18544 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgr.pl8
-rw-r--r--Master/tlpkg/TeXLive/TLConfFile.pm10
2 files changed, 8 insertions, 10 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl
index 6c76511fa1b..d6dd8f77d69 100755
--- a/Master/texmf/scripts/texlive/tlmgr.pl
+++ b/Master/texmf/scripts/texlive/tlmgr.pl
@@ -4074,14 +4074,10 @@ sub action_conf {
if ($arg eq "tlmgr") {
chomp (my $TEXMFCONFIG = `kpsewhich -var-value=TEXMFCONFIG`);
$fn = "$TEXMFCONFIG/tlmgr/config";
- if (-r $fn) {
- $cf = TeXLive::TLConfFile->new($fn, "#", "=");
- }
+ $cf = TeXLive::TLConfFile->new($fn, "#", "=");
} else {
$fn = "$Master/texmf.cnf";
- if (-r $fn) {
- $cf = TeXLive::TLConfFile->new($fn, "[%#]", "=");
- }
+ $cf = TeXLive::TLConfFile->new($fn, "[%#]", "=");
}
my ($key, $val) = @ARGV;
if (!defined($key)) {
diff --git a/Master/tlpkg/TeXLive/TLConfFile.pm b/Master/tlpkg/TeXLive/TLConfFile.pm
index 17233ca201f..01567d602b2 100644
--- a/Master/tlpkg/TeXLive/TLConfFile.pm
+++ b/Master/tlpkg/TeXLive/TLConfFile.pm
@@ -237,12 +237,14 @@ sub save
#
sub parse_config_file {
my ($file, $cc, $sep) = @_;
+ my @data;
if (!open(CFG, "<$file")) {
- return;
+ @data = ();
+ } else {
+ @data = <CFG>;
+ chomp(@data);
+ close(CFG);
}
- my @data = <CFG>;
- chomp(@data);
- close(CFG);
my %config = ();
$config{'file'} = $file;