From e1926abfc8b55444fde16c6a69b72592d12d01ec Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Fri, 6 May 2016 04:11:32 +0000 Subject: don't die in user moder on updmap.cfg write, make backup git-svn-id: svn://tug.org/texlive/trunk@40911 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/TeXLive/TLUtils.pm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'Master/tlpkg') diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index 5e08a95493a..6fbcff6c5c2 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -191,6 +191,7 @@ BEGIN { use Cwd; use Getopt::Long; use File::Temp; +use File::Copy qw//; use TeXLive::TLConfig; @@ -2727,6 +2728,7 @@ sub _create_config_files { $tlpdblinesref, @postlines) = @_; my $root = $tlpdb->root; my @lines = (); + my $usermode = $tlpdb->setting( "usertree" ); if (-r "$root/$headfile") { # we might be in user mode and do *not* want that the generation # of the configuration file just boils out. @@ -2735,11 +2737,7 @@ sub _create_config_files { @lines = ; close (INFILE); } else { - tlwarn("TLUtils::_create_config_files: $root/$headfile missing!\n"); - # TODO - # if we allow tlmgr generate to generate language.* file in usermode - # we need to remove the die here! - die ("Giving up."); + die ("Giving up.") if (!$usermode); } push @lines, @$tlpdblinesref; if (defined($localconf) && -r $localconf) { @@ -2756,6 +2754,10 @@ sub _create_config_files { 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: $!"); -- cgit v1.2.3