summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2012-01-11 23:00:09 +0000
committerNorbert Preining <preining@logic.at>2012-01-11 23:00:09 +0000
commit1b573241c7d7e20b9427666570c439f7c9f875a3 (patch)
tree63dc65683bc27f40b138217706874258dafca901
parent7bc9ca96c3424bfad721f18d5111024941eba8dc (diff)
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
-rwxr-xr-xMaster/texmf/scripts/texlive/mupdmap.pl28
1 files changed, 24 insertions, 4 deletions
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};
}
}