summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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};
}
}