diff options
author | Norbert Preining <preining@logic.at> | 2011-09-06 01:30:14 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2011-09-06 01:30:14 +0000 |
commit | 04a7f780cb7eed923f59a22a9fba691867335494 (patch) | |
tree | caeb1a5643208a729a6a9842ba1ac03e87462132 | |
parent | 7eb050249ebf3cb7bda87b8a1425b5459a7eb688 (diff) |
reorder config files to move TEXMFLOCAL updmap.cfg up
add some docs
cleanup
git-svn-id: svn://tug.org/texlive/trunk@23842 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/tlpkg/dev/multi-updmap.pl | 52 |
1 files changed, 43 insertions, 9 deletions
diff --git a/Master/tlpkg/dev/multi-updmap.pl b/Master/tlpkg/dev/multi-updmap.pl index e97159b7e40..f019b870c10 100644 --- a/Master/tlpkg/dev/multi-updmap.pl +++ b/Master/tlpkg/dev/multi-updmap.pl @@ -134,13 +134,38 @@ sub main { push @used_files, $f; } } + # reorder used files: since we ship and manage with tlmgr + # the file in TEXMFSYSCONFIG, and TEXMFLOCAL has *lower* priority + # then TEXMFSYSCONFIG, we move a TEXMFLOCAL-updmap.cfg if found + # after TEXMFCONFIG TEXMFVAR and TEXMFHOME + chomp(my $TEXMFLOCAL =`kpsewhich --var-value=TEXMFLOCAL`); + chomp(my $TEXMFHOME =`kpsewhich --var-value=TEXMFHOME`); + if (grep($TEXMFLOCAL, @used_files)) { + my @tmp; + my $local_pushed = 0; + for my $f (@used_files) { + if ($f =~ m!$TEXMFCONFIG|$TEXMFVAR|$TEXMFHOME!) { + push @tmp, $f; + } else { + if (!$local_pushed) { + # should we use the return value of grep here, but we know + # what we will find?!?! + push @tmp, "$TEXMFLOCAL/web2c/updmap.cfg"; + $local_pushed = 1; + } + # push the original + push @tmp, $f unless ($f =~ m!$TEXMFLOCAL!); + } + } + @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) # then use the *top* file (which will be either one of the two), # if none of the two exists, create a file in TEXMFCONFIG and use it chomp(my $TEXMFHOME = `kpsewhich -var-value=TEXMFHOME`); - my @final = @used_files; my $use_top = 0; for my $f (@used_files) { if ($f =~ m!($TEXMFHOME|$TEXMFCONFIG)/web2c/updmap.cfg!) { @@ -154,10 +179,7 @@ sub main { # add the empty config file my $dn = "$TEXMFCONFIG/web2c"; $changes_config_file = "$dn/updmap.cfg"; - # don't use used_files here, it goes into an infinite loop! - #unshift @final, $changes_config_file; } - @{$opts{'cnffile'}} = @final; } print "$prg is using the following updmap.cfg files (in precedence order):\n"; for my $f (@{$opts{'cnffile'}}) { @@ -1501,8 +1523,8 @@ Usage: $prg [OPTION] ... [COMMAND] or: $prg-sys [OPTION] ... [COMMAND] Update the default font map files used by pdftex, dvips, and dvipdfm(x), -as determined by the configuration file updmap.cfg (the one returned by -running "kpsewhich updmap.cfg"). +as determined by all configuration files updmap.cfg (the one returned by +running "kpsewhich --all updmap.cfg"). Among other things, these map files are used to determine which fonts should be used as bitmaps and which as outlines, and to determine which @@ -1574,14 +1596,26 @@ Explanation of trees and files normally used: updmap reads all the updmap.cfg found by kpsewhich -all updmap.cfg or those given on the command line with --cnffile. - According to the actions it might write to the so called "top level" - updmap.cfg file. This "top level" file is either the *first* one given - on the command line, or the first one found with kpsewhich -all updmap.cfg. + According to the actions it might write to one of the given files or + create a new updmap.cfg, see below for details. If multiple updmap.cfg files are found, all the map files mentioned in all the updmap.cfg files are merged. CAVEATS with multiple updmap.cfg files + * where changes are saved + If config files are given on the cmd line, then the first given will + be used to save changes (by --setoption, --enable or --disable). + If the config files are taken from kpsewhich, then the algorithm is + more complex: + - if one of \$TEXMFHOME/web2c/updmap.cfg or \$TEXMFCONFIG/web2c/updmap.cfg + appears in the list of used files, then the one given *first* by + kpsewhich --all, or equivalently, the one given by kpsewhich updmap.cfg, + is used + - if none of the above two are present, a new config file is created + in \$TEXMFCONFIG/web2c/updmap.cfg (in case there are actual changes) + and used + * multiple font definitions If a font is defined multiple times in different maps, then the definition of the map file that comes from the highest priority |