From 8e28c1af228ba56dc0380b2689f7516e459cc966 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Fri, 6 May 2016 22:53:30 +0000 Subject: TLUtils:_create_config_file: generate file even with no entries If the last entry of a config file is removed we still need to recreate a config file. Example: Last package shipping a .map file is removed, then also this last entry from updmap.cfg needs to be removed. Thanks Ken Brown for pointing this out. git-svn-id: svn://tug.org/texlive/trunk@40922 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/TeXLive/TLUtils.pm | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'Master/tlpkg') diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index 6fbcff6c5c2..52fd4c9159f 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -2753,21 +2753,19 @@ sub _create_config_files { if (@postlines) { push @lines, @postlines; } - if ($#lines >= 0) { - if ($usermode && -e $dest) { - tlwarn("Updating $dest, backup copy in $dest.backup\n"); - File::Copy::copy($dest, "$dest.backup"); - } - open(OUTFILE,">$dest") - or die("Cannot open $dest for writing: $!"); + if ($usermode && -e $dest) { + tlwarn("Updating $dest, backup copy in $dest.backup\n"); + File::Copy::copy($dest, "$dest.backup"); + } + open(OUTFILE,">$dest") + or die("Cannot open $dest for writing: $!"); - if (!$keepfirstline) { - print OUTFILE $cc; - printf OUTFILE " Generated by %s on %s\n", "$0", scalar localtime; - } - print OUTFILE @lines; - close(OUTFILE) || warn "close(>$dest) failed: $!"; + if (!$keepfirstline) { + print OUTFILE $cc; + printf OUTFILE " Generated by %s on %s\n", "$0", scalar localtime; } + print OUTFILE @lines; + close(OUTFILE) || warn "close(>$dest) failed: $!"; } sub parse_AddHyphen_line { -- cgit v1.2.3