diff options
Diffstat (limited to 'Master/tlpkg')
-rw-r--r-- | Master/tlpkg/TeXLive/TLUtils.pm | 12 |
1 files changed, 7 insertions, 5 deletions
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 = <INFILE>; 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: $!"); |