diff options
Diffstat (limited to 'Master')
-rwxr-xr-x | Master/texmf/scripts/tetex/updmap.pl | 76 |
1 files changed, 30 insertions, 46 deletions
diff --git a/Master/texmf/scripts/tetex/updmap.pl b/Master/texmf/scripts/tetex/updmap.pl index 99e939a8236..6e6235e19d0 100755 --- a/Master/texmf/scripts/tetex/updmap.pl +++ b/Master/texmf/scripts/tetex/updmap.pl @@ -15,13 +15,6 @@ # limitation. # # TODO -# IMPORTANT: When a config files is created the FIRST TIME -# it is not included in the following update of maps -# because it does NOT appear in the list of used cnffiles!!! -# We have to re-run the list of files decision routine -# probably best is to factor out the whole main function -# and call it once more from within after an option has -# been set or map enabled/disabled # - check all other invocations # - after TL2012? remove -oldmode version # - after TL2012? Maybe remove support for reading updmap-local.cfg @@ -71,6 +64,7 @@ my $updLSR; my @cmdline_options = ( "oldmode", + "listfiles", "cnffile=s@", "copy", "disable=s@", @@ -104,7 +98,6 @@ my @cmdline_options = ( "help|h", # some debugging invocations "_readsave=s", - "_listupdmap", ); my %settings = ( @@ -320,12 +313,13 @@ sub main { print " $f\n"; } } - $alldata->{'changes_config'} = $changes_config_file; - - if ($opts{'_listupdmap'}) { + if ($opts{'listfiles'}) { + # we listed it above, so be done exit 0; } + $alldata->{'changes_config'} = $changes_config_file; + read_updmap_files(@{$opts{'cnffile'}}); if ($opts{'showoption'}) { @@ -367,7 +361,6 @@ sub main { exit 0; } - # what does this? $updLSR = &mktexupd(); $updLSR->{mustexist}(0); @@ -414,13 +407,6 @@ sub main { unshift @aaa, $changes_config_file; $alldata->{'order'} = [ @aaa ]; # - # since things have changed, reread the whole updmap files - if ($changed) { - delete $alldata->{'updmap'}; - delete $alldata->{'maps'}; - read_updmap_files(@{$opts{'cnffile'}}) if $changed; - } - # setupOutputDir("dvips"); setupOutputDir("pdftex"); setupOutputDir("dvipdfmx"); @@ -1204,6 +1190,7 @@ sub enable_disable_maps { die "$prg: top config file $tc has not been read." if (!defined($alldata->{'updmap'}{$tc})); my $changed = 0; + for my $w (@what) { if ($w =~ m/=/) { # this is --enable MapType=MapName @@ -1214,6 +1201,7 @@ sub enable_disable_maps { disable_map($tc, $w); } } + merge_settings(); return save_updmap($tc); } @@ -1583,10 +1571,31 @@ sub read_updmap_files { } # $alldata->{'order'} = \@l; + + # merge data and check for kanji embed + merge_settings(); +} + +sub merge_settings { # - # merge the settings so that we can check for kanjiEmbed + my @l = @{$alldata->{'order'}}; # - merge_settings(); + # for security clean out everything that was there + %{$alldata->{'merged'}} = (); + # + # first read in the settings + # we read it in *reverse* order and simple fill up the combined data + # thus if there are multiple definitions/settings, the one coming from + # the first in the original list will win! + for my $l (reverse @l) { + # merge settings + if (defined($alldata->{'updmap'}{$l}{'setting'})) { + for my $k (keys %{$alldata->{'updmap'}{$l}{'setting'}}) { + $alldata->{'merged'}{'setting'}{$k}{'val'} = $alldata->{'updmap'}{$l}{'setting'}{$k}{'val'}; + $alldata->{'merged'}{'setting'}{$k}{'origin'} = $l; + } + } + } # my ($kanjiEmbed, $kanjiEmbed_origin) = get_cfg('kanjiEmbed'); my ($kanjiVariant, $kanjiVariant_origin) = get_cfg('kanjiVariant'); @@ -1819,31 +1828,6 @@ sub read_map_file { } # -# merge and update the setting -# -sub merge_settings { - my @l = @{$alldata->{'order'}}; - # - # for security clean out everything that was there - %{$alldata->{'merged'}} = (); - # - # first read in the settings - # we read it in *reverse* order and simple fill up the combined data - # thus if there are multiple definitions/settings, the one coming from - # the first in the original list will win! - for my $l (reverse @l) { - # merge settings - if (defined($alldata->{'updmap'}{$l}{'setting'})) { - for my $k (keys %{$alldata->{'updmap'}{$l}{'setting'}}) { - $alldata->{'merged'}{'setting'}{$k}{'val'} = $alldata->{'updmap'}{$l}{'setting'}{$k}{'val'}; - $alldata->{'merged'}{'setting'}{$k}{'origin'} = $l; - } - } - } - # -} - -# # merging the various font definitions # sub merge_data { |