From cf39bc3c8563ac5eefb8ade651c535d4e6028017 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 11 Jul 2012 23:13:31 +0000 Subject: make sure we remove old updmap.cfg files in TEXMFSYSCONFIG git-svn-id: svn://tug.org/texlive/trunk@27000 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/TeXLive/TLUtils.pm | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'Master') diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index a5ac3af1122..575ea5733d7 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -2678,11 +2678,51 @@ sub create_fmtutil { sub create_updmap { my ($tlpdb,$dest) = @_; + check_for_old_updmap_cfg(); my @tlpdblines = $tlpdb->updmap_cfg_lines(); _create_config_files($tlpdb, "texmf/web2c/updmap-hdr.cfg", $dest, undef, 0, '#', \@tlpdblines); } +sub check_for_old_updmap_cfg { + chomp( my $tmfsysconf = `kpsewhich -var-value=TEXMFSYSCONFIG` ) ; + if (-r "$tmfsysconf/web2c/updmap.cfg") { + # assume that succeeds, we tested -r above! + open (FOO, "<$tmfsysconf/web2c/updmap.cfg"); + chomp( my $firstline = ); + close(FOO); + if ($firstline =~ m/^# Generated by (install-tl|.*\/tlmgr) on/) { + # rename it + my $nn = "$tmfsysconf/web2c/updmap.cfg.DISABLED"; + if (-r $nn) { + my $fh; + ($fh, $nn) = File::Temp::tempfile( + "updmap.cfg.DISABLED.XXXXXX", DIR => "$tmfsysconf/web2c"); + } + print "Renaming old config file from + $tmfsysconf/web2c/updmap.cfg +to + $nn\n"; + if (rename("$tmfsysconf/web2c/updmap.cfg", $nn)) { + system("mktexlsr",$tmfsysconf); + } else { + print STDERR " +Renaming did not succeed, note that + $tmfsysconf/web2c/updmap.cfg +should not be used anymore! +Please see the documentation for updmap. +"; + } + } else { + print STDERR "Config file $tmfsysconf/web2c/updmap.cfg. +This config file should not be used anymore, please read the documentation +of updmap. +"; + } + } + # we don't do any error reporting here, what could we do? +} + sub check_updmap_config_value { my ($k, $v, $f) = @_; return 0 if !defined($k); -- cgit v1.2.3