summaryrefslogtreecommitdiff
path: root/Master/tlpkg
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2012-07-11 23:13:31 +0000
committerNorbert Preining <preining@logic.at>2012-07-11 23:13:31 +0000
commitcf39bc3c8563ac5eefb8ade651c535d4e6028017 (patch)
treecba0fe970397b4d19e79e4c7f1604f6768e21bda /Master/tlpkg
parent5a2d5ae261bcc502af3a73e980f0f9847ab35709 (diff)
make sure we remove old updmap.cfg files in TEXMFSYSCONFIG
git-svn-id: svn://tug.org/texlive/trunk@27000 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg')
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm40
1 files changed, 40 insertions, 0 deletions
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 = <FOO> );
+ 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);