2
  9   qˆl—Ým_Jõ!®Å2 ¸ÛWmLZ7ÿ‘þBÛì�fåx­3+²–�üÿÕ„yæ]{ÚÀ× ?÷     q#!/usr/bin/perl
# Debian required shebang above
# Original shebang below
# #!/usr/bin/env perl
# $Id: updmap.pl 63644 2022-06-18 22:30:39Z karl $
# updmap - maintain map files for outline fonts.
# (Maintained in TeX Live:Master/texmf-dist/scripts/texlive.)
# 
# Copyright 2011-2022 Norbert Preining
# This file is licensed under the GNU General Public License version 2
# or any later version.
#
# History:
# Original shell script (C) 2002 Thomas Esser, released to the public domain.
# first perl variant by Fabrice Popineau
# later adaptions by Reinhard Kotucha, and Karl Berry.
# The current implementation is a complete rewrite.

my $svnid = '$Id: updmap.pl 63644 2022-06-18 22:30:39Z karl $';

my $TEXMFROOT;
BEGIN {
  $^W = 1;
  $TEXMFROOT = `kpsewhich -var-value=TEXMFROOT`;
  if ($?) {
    die "$0: kpsewhich -var-value=TEXMFROOT failed, aborting early.\n";
  }
  chomp($TEXMFROOT);
  unshift (@INC, "/usr/share/texlive/tlpkg");
}

my $lastchdate = '$Date: 2022-06-19 00:30:39 +0200 (Sun, 19 Jun 2022) $';
$lastchdate =~ s/^\$Date:\s*//;
$lastchdate =~ s/ \(.*$//;
my $svnrev = '$Revision: 63644 $';
$svnrev =~ s/^\$Revision:\s*//;
$svnrev =~ s/\s*\$$//;
my $version = "r$svnrev ($lastchdate)";

use Getopt::Long qw(:config no_autoabbrev ignore_case_always);
use strict;
use TeXLive::TLUtils qw(mkdirhier mktexupd win32 basename dirname 
  sort_uniq member touch);

(my $prg = basename($0)) =~ s/\.pl$//;

# sudo sometimes does not reset the home dir of root;
# see more comments at the definition of this function.
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",
  "user",
  "listfiles",
  "cnffile=s@", 
  "copy", 
  "disable=s@",
  "dvipdfmoutputdir=s",
  "dvipdfmxoutputdir=s",
  "dvipsoutputdir=s",
  # the following does not work, Getopt::Long looses the first
  # entry in a multi setting, treat it separately in processOptions
  # furthermore, it is not supported by older perls, so do it differently
  #"enable=s{1,2}",
  "edit",
  "force",
  "listavailablemaps",
  "listmaps|l",
  "nohash",
  "nomkmap",
  "dry-run|n",
  "outputdir=s",
  "pdftexoutputdir=s",
  "pxdvioutputdir=s",
  "quiet|silent|q",
  # the following is a correct specification of an option according
  # to the manual, but it does not work!
  # we will treat that option by itself in processOptions
  # furthermore, it is not supported by older perls, so do it differently
  #"setoption=s@{1,2}",
  "showoptions=s@",
  "showoption=s@",
  "syncwithtrees",
  "version",
  "help|h",
  # some debugging invocations
  "_readsave=s",
  "_dump",
  );

my %settings = (
  dvipsPreferOutline    => {
    type     => "binary",
    default  => "true",
  },
  LW35                  => {
    type     => "string",
    possible => [ qw/URW URWkb ADOBE ADOBEkb/ ],
    default  => "URWkb",
  },
  dvipsDownloadBase35   => {
    type     => "binary",
    default  => "true",
  },
  pdftexDownloadBase14  => {
    type     => "binary",
    default  => "true",
  },
  dvipdfmDownloadBase14 => {
    type     => "binary",
    default  => "true",
  },
  pxdviUse              => {
    type     => "binary",
    default  => "false",
  },
  jaEmbed               => {
    type     => "any",
    default  => "noEmbed",
  },
