diff options
author | Norbert Preining <preining@logic.at> | 2012-07-30 00:42:59 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2012-07-30 00:42:59 +0000 |
commit | 31f29d57d189c34826a27adf11b3711d9c5dfdc3 (patch) | |
tree | dcbd1fcbefaed3699c6db93d7c7ec39424dce18d | |
parent | abbf7f69b9adb32fcec0d5772a51c76f71feaace (diff) |
update updmap.pl from source
git-svn-id: svn://tug.org/texlive/trunk@27240 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-x | Master/texmf/scripts/tetex/updmap.pl | 78 |
1 files changed, 36 insertions, 42 deletions
diff --git a/Master/texmf/scripts/tetex/updmap.pl b/Master/texmf/scripts/tetex/updmap.pl index 7df639072f9..4cbbc34fa8d 100755 --- a/Master/texmf/scripts/tetex/updmap.pl +++ b/Master/texmf/scripts/tetex/updmap.pl @@ -1,6 +1,6 @@ #!/usr/bin/env perl # mupdmap: utility to maintain map files for outline fonts. -# $Id: updmap.pl 26891 2012-06-10 22:41:49Z karl $ +# $Id: updmap.pl 27239 2012-07-30 00:35:24Z preining $ # # Copyright 2011, 2012 Norbert Preining # This file is licensed under the GNU General Public License version 2 @@ -33,7 +33,7 @@ BEGIN { } -my $version = '$Id: updmap.pl 26891 2012-06-10 22:41:49Z karl $'; +my $version = '$Id: updmap.pl 27239 2012-07-30 00:35:24Z preining $'; use Getopt::Long qw(:config no_autoabbrev ignore_case_always); use strict; @@ -220,43 +220,35 @@ sub main { push @used_files, (win32() ? lc($f) : $f); } # - chomp(my $TEXMFLOCAL =`kpsewhich --var-value=TEXMFLOCAL`); + chomp(my $TEXMFLOCALVAR =`kpsewhich --expand-path='\$TEXMFLOCAL'`); + my @TEXMFLOCAL = split /:/ , $TEXMFLOCALVAR; chomp(my $TEXMFHOME =`kpsewhich --var-value=TEXMFHOME`); if (win32()) { - $TEXMFLOCAL = lc($TEXMFLOCAL); + @TEXMFLOCAL = lc(@TEXMFLOCAL); $TEXMFHOME = lc($TEXMFHOME); } # # search for TEXMFLOCAL/web2c/updmap.cfg - # see compatibility with updmap-local.cfg below - my $found = 0; - my $TMLabs = Cwd::abs_path($TEXMFLOCAL); - if ($TMLabs) { - for my $f (@used_files) { - my $absf = Cwd::abs_path($f); #should always work - if ($absf =~ m/^\Q$TMLabs\E/) { - $found = 1; - last; - } + # check for compatibility with old updmap-local.cfg + my @tmlused; + for my $tml (@TEXMFLOCAL) { + my $TMLabs = Cwd::abs_path($tml); + next if (!$TMLabs); + my $oldfound = 0; + if (-r "$TMLabs/web2c/updmap-local.cfg") { + push @tmlused, "$TMLabs/web2c/updmap-local.cfg"; + warning("Old configuration file\n $TMLabs/web2c/updmap-local.cfg\nfound! "); + $oldfound = 1; } - } - # - # backward compatibility with TL2011 and before updmap-local.cfg - # we read this instead of TEXMFLOCAL/web2c/updmap.cfg, but give - # a big fat warning - my $old_updmap_local_found = 0; - if (-r "$TMLabs/web2c/updmap-local.cfg") { - $old_updmap_local_found = 1; - warning("Old configuration file TEXMFLOCAL/web2c/updmap-local.cfg found!\n"); - if ($found) { - warning("Will read this file *instead* of TEXMFLOCAL/web2c/updmap.cfg!!!\n"); - # rest of the action is done in the reordering of cfg files - } else { - # if TEXMFLOCAL updmap.cfg does not exist, we have to make sure - # that the replacement is added to the list of updmap files - push @used_files, "$TMLabs/web2c/updmap-local.cfg"; + if (-r "$TMLabs/web2c/updmap.cfg") { + if ($oldfound) { + warning("Will read it *instead* of\n $TMLabs/web2c/updmap.cfg\n"); + } else { + push @tmlused, "$TMLabs/web2c/updmap.cfg"; + } } - warning("Please consider moving the information from updmap-local.cfg to TEXMFLOCAL/web2c/updmap.cfg\n"); + warning("Please consider moving the information from updmap-local.cfg to\n $TMLabs/web2c/updmap.cfg\n") + if ($oldfound); } # # reorder used files: we move TEXMFLOCAL (if used) just above TEXMFMAIN @@ -300,27 +292,27 @@ sub main { # TEXMFMAIN $TEXLIVE/YYYY/texmf/web2c/updmap.cfg # TEXMFDIST $TEXLIVE/YYYY/texmf-dist/web2c/updmap.cfg # - if ($found || $old_updmap_local_found) { + if (@tmlused) { my @tmp; for my $f (@used_files) { if ($f =~ m!\Q$TEXMFMAIN/\E!) { - if ($old_updmap_local_found) { - push @tmp, "$TEXMFLOCAL/web2c/updmap-local.cfg"; - } else { - # since we are under if ($found || $old_updmap_local_found) - # we know that TEXMFLOCAL/web2c/updmap.cfg exists! - push @tmp, "$TEXMFLOCAL/web2c/updmap.cfg"; - } + push @tmp, @tmlused; push @tmp, $f; } else { - if ($f !~ m!\Q$TEXMFLOCAL\E!) { - push @tmp, $f; + 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 # if in the list of used files contains either one from # TEXMFHOME or TEXMFCONFIG (which is TEXMFSYSCONFIG in the -sys case) @@ -346,6 +338,8 @@ sub main { for my $f (@{$opts{'cnffile'}}) { print " $f\n"; } + print "$prg is using the following updmap.cfg file for writing changes:\n"; + print " $changes_config_file\n"; } if ($opts{'listfiles'}) { # we listed it above, so be done @@ -2012,7 +2006,7 @@ fonts worse than mode-tuned Type 1 bitmap fonts. So, MixedMap is used for fonts that are available as both Type 1 and Metafont. KanjiMap entries are added to psfonts_t1.map and kanjix.map. -Explanation of the OPTION names for --showoptions, --showoptions, --setoption: +Explanation of the OPTION names for --showoptions, --showoption, --setoption: dvipsPreferOutline true|false (default true) Whether dvips uses bitmaps or outlines, when both are available. |