From 1b573241c7d7e20b9427666570c439f7c9f875a3 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 11 Jan 2012 23:00:09 +0000 Subject: mupdmap: fix writing of updmap files, fix reinsertion of @kanjiEmbed@ in the written updmap.cfg file git-svn-id: svn://tug.org/texlive/trunk@25072 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf/scripts/texlive/mupdmap.pl | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) (limited to 'Master') diff --git a/Master/texmf/scripts/texlive/mupdmap.pl b/Master/texmf/scripts/texlive/mupdmap.pl index 09aa796cee6..ea1900cd153 100755 --- a/Master/texmf/scripts/texlive/mupdmap.pl +++ b/Master/texmf/scripts/texlive/mupdmap.pl @@ -15,7 +15,6 @@ # limitation. # # TODO -# - fix --setoption xxx YYY # - check all other invocations # # TODO after inclusion in TL: @@ -96,7 +95,9 @@ my @cmdline_options = ( "showoption=s@", "syncwithtrees", "version", - "help|h" + "help|h", + # some debugging invocations + "_readsave=s", ); my %settings = ( @@ -140,6 +141,15 @@ sub main { help() if $opts{'help'}; + if ($opts{'_readsave'}) { + read_updmap_files($opts{'_readsave'}); + print "READING DONE ============================\n"; + #print Dumper($alldata); + $alldata->{'updmap'}{$opts{'_readsave'}}{'changed'} = 1; + save_updmap($opts{'_readsave'}); + exit 0; + } + if ($opts{'showoptions'}) { for my $o (@{$opts{'showoptions'}}) { if (defined($settings{$o})) { @@ -1251,11 +1261,20 @@ sub save_updmap { print FN "$k $v\n"; } elsif (defined($line_to_map{$i})) { my $m = $line_to_map{$i}; + my $rm; + if (defined($upd{'maps'}{$m}{'original'})) { + # we have the case that @noEmbed@ was replaced by the respective + # setting. Before writing out we have to replace this back with + # the original line!A + $rm = $upd{'maps'}{$m}{'original'}; + } else { + $rm = $m; + } my $t = $upd{'maps'}{$m}{'type'}; my $p = ($upd{'maps'}{$m}{'status'} eq "disabled" ? "#! " : ""); - print FN "$p$t $m\n"; + print FN "$p$t $rm\n"; } else { - print "$lines[$i]\n"; + print FN "$lines[$i]\n"; } } # add the new settings and maps @@ -1518,6 +1537,7 @@ sub read_updmap_files { $alldata->{'updmap'}{$l}{'maps'}{$m}{'status'}; $alldata->{'updmap'}{$l}{'maps'}{$newm}{'line'} = $alldata->{'updmap'}{$l}{'maps'}{$m}{'line'}; + $alldata->{'updmap'}{$l}{'maps'}{$newm}{'original'} = $m; delete $alldata->{'updmap'}{$l}{'maps'}{$m}; } } -- cgit v1.2.3