From 9ff55323bdb88ede985266ee9123bc2cdda58848 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Fri, 19 Apr 2013 19:47:12 +0000 Subject: fix updmap bugs (mail Michael Sharpe 16Apr) - updmap.pl: pull in touch from TLUtils - updmap.pl: remove any trace of TEXMFMAIN - TLUtils.pm: fix touch function to actually create a new file git-svn-id: svn://tug.org/texlive/trunk@30043 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/scripts/texlive/updmap.pl | 58 +++-------------------------- Master/tlpkg/TeXLive/TLUtils.pm | 7 +++- 2 files changed, 10 insertions(+), 55 deletions(-) diff --git a/Master/texmf-dist/scripts/texlive/updmap.pl b/Master/texmf-dist/scripts/texlive/updmap.pl index d668a092f9e..463f0367308 100755 --- a/Master/texmf-dist/scripts/texlive/updmap.pl +++ b/Master/texmf-dist/scripts/texlive/updmap.pl @@ -39,7 +39,7 @@ my $version = '$Id$'; use Getopt::Long qw(:config no_autoabbrev ignore_case_always); use strict; use TeXLive::TLUtils qw(mkdirhier mktexupd win32 basename dirname - sort_uniq member); + sort_uniq member touch); #use Data::Dumper; #$Data::Dumper::Indent = 1; @@ -51,14 +51,14 @@ use TeXLive::TLUtils qw(mkdirhier mktexupd win32 basename dirname # this function checks by itself whether it is running on windows or not reset_root_home(); -chomp(my $TEXMFMAIN = `kpsewhich --var-value=TEXMFMAIN`); +chomp(my $TEXMFDIST = `kpsewhich --var-value=TEXMFDIST`); chomp(my $TEXMFVAR = `kpsewhich -var-value=TEXMFVAR`); chomp(my $TEXMFCONFIG = `kpsewhich -var-value=TEXMFCONFIG`); chomp(my $TEXMFHOME = `kpsewhich -var-value=TEXMFHOME`); # make sure that on windows *everything* is in lower case for comparison if (win32()) { - $TEXMFMAIN = lc($TEXMFMAIN); + $TEXMFDIST = lc($TEXMFDIST); $TEXMFVAR = lc($TEXMFVAR); $TEXMFCONFIG = lc($TEXMFCONFIG); $TEXMFROOT = lc($TEXMFROOT); @@ -257,66 +257,23 @@ sub main { if ($oldfound); } # - # reorder used files: we move TEXMFLOCAL (if used) just above TEXMFMAIN - # as sysadmins will probably adjust values there - # # updmap (user): # ============== - # as found: - # TEXMFCONFIG $HOME/.texliveYYYY/texmf-config/web2c/updmap.cfg - # TEXMFVAR $HOME/.texliveYYYY/texmf-var/web2c/updmap.cfg - # TEXMFHOME $HOME/texmf/web2c/updmap.cfg - # TEXMFSYSCONFIG $TEXLIVE/YYYY/texmf-config/web2c/updmap.cfg - # TEXMFSYSVAR $TEXLIVE/YYYY/texmf-var/web2c/updmap.cfg - # TEXMFMAIN $TEXLIVE/YYYY/texmf/web2c/updmap.cfg - # TEXMFLOCAL $TEXLIVE/texmf-local/web2c/updmap.cfg - # TEXMFDIST $TEXLIVE/YYYY/texmf-dist/web2c/updmap.cfg - # - # as used: # TEXMFCONFIG $HOME/.texliveYYYY/texmf-config/web2c/updmap.cfg # TEXMFVAR $HOME/.texliveYYYY/texmf-var/web2c/updmap.cfg # TEXMFHOME $HOME/texmf/web2c/updmap.cfg # TEXMFSYSCONFIG $TEXLIVE/YYYY/texmf-config/web2c/updmap.cfg # TEXMFSYSVAR $TEXLIVE/YYYY/texmf-var/web2c/updmap.cfg # TEXMFLOCAL $TEXLIVE/texmf-local/web2c/updmap.cfg - # TEXMFMAIN $TEXLIVE/YYYY/texmf/web2c/updmap.cfg # TEXMFDIST $TEXLIVE/YYYY/texmf-dist/web2c/updmap.cfg # # updmap-sys (root): # ================== - # as found: - # TEXMFSYSCONFIG $TEXLIVE/YYYY/texmf-config/web2c/updmap.cfg - # TEXMFSYSVAR $TEXLIVE/YYYY/texmf-var/web2c/updmap.cfg - # TEXMFMAIN $TEXLIVE/YYYY/texmf/web2c/updmap.cfg - # TEXMFLOCAL $TEXLIVE/texmf-local/web2c/updmap.cfg - # TEXMFDIST $TEXLIVE/YYYY/texmf-dist/web2c/updmap.cfg - # - # as used: # TEXMFSYSCONFIG $TEXLIVE/YYYY/texmf-config/web2c/updmap.cfg # TEXMFSYSVAR $TEXLIVE/YYYY/texmf-var/web2c/updmap.cfg # TEXMFLOCAL $TEXLIVE/texmf-local/web2c/updmap.cfg - # TEXMFMAIN $TEXLIVE/YYYY/texmf/web2c/updmap.cfg # TEXMFDIST $TEXLIVE/YYYY/texmf-dist/web2c/updmap.cfg # - if (@tmlused) { - my @tmp; - for my $f (@used_files) { - if ($f =~ m!\Q$TEXMFMAIN/\E!) { - push @tmp, @tmlused; - push @tmp, $f; - } else { - my $pushit = 1; - for my $tml (@TEXMFLOCAL) { - if ($f =~ m!\Q$tml\E!) { - $pushit = 0; - last; - } - } - push @tmp, $f if ($pushit); - } - } - @used_files = @tmp; - } @{$opts{'cnffile'}} = @used_files; # # determine the config file that we will use for changes @@ -2193,10 +2150,7 @@ Explanation of trees and files normally used: If --cnffile is specified on the command line (possibly multiple times), its value(s) are used. Otherwise, updmap reads all the updmap.cfg files found by running \`kpsewhich -all updmap.cfg', in the - order returned by kpsewhich, with one exception: an updmap.cfg found - in TEXMFLOCAL is given higher priority than the updmap.cfg in - TEXMFMAIN, to ensure that local adjustments by administrators take - precedence over what is shipped in TeX Live. + order returned by kpsewhich. In any case, if multiple updmap.cfg files are found, all the maps mentioned in all the updmap.cfg files are merged. @@ -2209,7 +2163,6 @@ Explanation of trees and files normally used: TEXMFSYSCONFIG \$TEXLIVE/YYYY/texmf-config/web2c/updmap.cfg TEXMFSYSVAR \$TEXLIVE/YYYY/texmf-var/web2c/updmap.cfg TEXMFLOCAL \$TEXLIVE/texmf-local/web2c/updmap.cfg - TEXMFMAIN \$TEXLIVE/YYYY/texmf/web2c/updmap.cfg TEXMFDIST \$TEXLIVE/YYYY/texmf-dist/web2c/updmap.cfg For updmap: @@ -2219,12 +2172,11 @@ Explanation of trees and files normally used: TEXMFSYSCONFIG \$TEXLIVE/YYYY/texmf-config/web2c/updmap.cfg TEXMFSYSVAR \$TEXLIVE/YYYY/texmf-var/web2c/updmap.cfg TEXMFLOCAL \$TEXLIVE/texmf-local/web2c/updmap.cfg - TEXMFMAIN \$TEXLIVE/YYYY/texmf/web2c/updmap.cfg TEXMFDIST \$TEXLIVE/YYYY/texmf-dist/web2c/updmap.cfg (where YYYY is the TeX Live release version). - There is another exception to keep upgradability from earlier versions + There is one exception to keep upgradability from earlier versions of TeX Live: if a file TEXMFLOCAL/web2c/updmap-local.cfg exists (formerly used by tlmgr to merge local fonts), then the file TEXMFLOCAL/web2c/updmap.cfg is ignored (if it exists) and that diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm index 825f6daf56a..351445b1cf4 100644 --- a/Master/tlpkg/TeXLive/TLUtils.pm +++ b/Master/tlpkg/TeXLive/TLUtils.pm @@ -971,8 +971,11 @@ sub touch { if (-e $file) { utime time, time, $file; } else { - open TMP, ">>$file" && close TMP - or warn "Can't update timestamps of $file: $!\n"; + if (open( TMP, ">$file")) { + close(TMP); + } else { + warn "Can't create file $file: $!\n"; + } } } } -- cgit v1.2.3