diff options
-rwxr-xr-x | Master/texmf-dist/scripts/texlive/updmap.pl | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/Master/texmf-dist/scripts/texlive/updmap.pl b/Master/texmf-dist/scripts/texlive/updmap.pl index db7bac6677a..2e2f40c0e6b 100755 --- a/Master/texmf-dist/scripts/texlive/updmap.pl +++ b/Master/texmf-dist/scripts/texlive/updmap.pl @@ -53,24 +53,32 @@ reset_root_home(); chomp(my $TEXMFDIST = `kpsewhich --var-value=TEXMFDIST`); chomp(my $TEXMFVAR = `kpsewhich -var-value=TEXMFVAR`); +chomp(my $TEXMFSYSVAR = `kpsewhich -var-value=TEXMFSYSVAR`); chomp(my $TEXMFCONFIG = `kpsewhich -var-value=TEXMFCONFIG`); +chomp(my $TEXMFSYSCONFIG = `kpsewhich -var-value=TEXMFSYSCONFIG`); chomp(my $TEXMFHOME = `kpsewhich -var-value=TEXMFHOME`); # make sure that on windows *everything* is in lower case for comparison if (win32()) { $TEXMFDIST = lc($TEXMFDIST); $TEXMFVAR = lc($TEXMFVAR); + $TEXMFSYSVAR = lc($TEXMFSYSVAR); $TEXMFCONFIG = lc($TEXMFCONFIG); + $TEXMFSYSCONFIG = lc($TEXMFSYSCONFIG); $TEXMFROOT = lc($TEXMFROOT); $TEXMFHOME = lc($TEXMFHOME); } +my $texmfconfig = $TEXMFCONFIG; +my $texmfvar = $TEXMFVAR; + my %opts = ( quiet => 0, nohash => 0, nomkmap => 0 ); my $alldata; my $updLSR; my @cmdline_options = ( + "sys", "listfiles", "cnffile=s@", "copy", @@ -157,6 +165,12 @@ sub main { exit (0); } + if ($opts{'sys'}) { + # we are running as updmap-sys, make sure that the right tree is used + $texmfconfig = $TEXMFSYSCONFIG; + $texmfvar = $TEXMFSYSVAR; + } + if ($opts{'dvipdfmoutputdir'} && !defined($opts{'dvipdfmxoutputdir'})) { $opts{'dvipdfmxoutputdir'} = $opts{'dvipdfmoutputdir'}; printf STDERR "Using --dvipdfmoutputdir options for dvipdfmx, but please use --dvipdfmxoutputdir\n"; @@ -283,7 +297,7 @@ sub main { # if none of the two exists, create a file in TEXMFCONFIG and use it my $use_top = 0; for my $f (@used_files) { - if ($f =~ m!(\Q$TEXMFHOME\E|\Q$TEXMFCONFIG\E)/web2c/updmap.cfg!) { + if ($f =~ m!(\Q$TEXMFHOME\E|\Q$texmfconfig\E)/web2c/updmap.cfg!) { $use_top = 1; last; } @@ -292,7 +306,7 @@ sub main { ($changes_config_file) = @used_files; } else { # add the empty config file - my $dn = "$TEXMFCONFIG/web2c"; + my $dn = "$texmfconfig/web2c"; $changes_config_file = "$dn/updmap.cfg"; } } @@ -925,10 +939,10 @@ sub get_cfg { sub mkMaps { my $logfile; - $logfile = "$TEXMFVAR/web2c/updmap.log"; + $logfile = "$texmfvar/web2c/updmap.log"; if (! $opts{'dry-run'}) { - mkdirhier("$TEXMFVAR/web2c"); + mkdirhier("$texmfvar/web2c"); open LOG, ">$logfile" or die "$prg: Can't open log file \"$logfile\": $!"; print LOG &version(); @@ -1292,7 +1306,7 @@ sub setupOutputDir { if ($opts{'outputdir'}) { $opts{$driver . "outputdir"} = $opts{'outputdir'}; } else { - $opts{$driver . "outputdir"} = "$TEXMFVAR/fonts/map/$driver/updmap"; + $opts{$driver . "outputdir"} = "$texmfvar/fonts/map/$driver/updmap"; } } my $od = $opts{$driver . "outputdir"}; @@ -2085,6 +2099,7 @@ Options: --force recreate files even if config hasn't changed --nomkmap do not recreate map files --nohash do not run texhash + --sys run in system wide mode (equivalent to updmap-sys) -n, --dry-run only show the configuration, no output --quiet, --silent reduce verbosity |