summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-04-16 17:26:57 +0000
committerKarl Berry <karl@freefriends.org>2017-04-16 17:26:57 +0000
commitdf88f83b1126c57b3ca9b0371071f36caba3fbbf (patch)
tree66470c82818ab9d2c2976336be6ed8ce4379db42 /Build
parenteb34bcb3c61d9f6d8e9c2b6f98e2f70db3110a84 (diff)
sync,doc
git-svn-id: svn://tug.org/texlive/trunk@43842 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/tests/TeXLive/TLConfig.pm6
-rw-r--r--Build/source/texk/tests/TeXLive/TLUtils.pm54
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/texlive/fmtutil.pl66
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/texlive/tlmgr.pl233
-rwxr-xr-xBuild/source/texk/texlive/linked_scripts/texlive/updmap.pl62
5 files changed, 330 insertions, 91 deletions
diff --git a/Build/source/texk/tests/TeXLive/TLConfig.pm b/Build/source/texk/tests/TeXLive/TLConfig.pm
index c1f6bbb1ff8..5e4deea47af 100644
--- a/Build/source/texk/tests/TeXLive/TLConfig.pm
+++ b/Build/source/texk/tests/TeXLive/TLConfig.pm
@@ -1,11 +1,11 @@
# TeXLive::TLConfig.pm - module exporting configuration values
-# Copyright 2007-2016 Norbert Preining
+# Copyright 2007-2017 Norbert Preining
# This file is licensed under the GNU General Public License version 2
# or any later version.
package TeXLive::TLConfig;
-my $svnrev = '$Revision: 41437 $';
+my $svnrev = '$Revision: 43775 $';
my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown";
sub module_revision { return $_modulerevision; }
@@ -51,7 +51,7 @@ BEGIN {
# the year of our release, will be used in the location of the
# network packages, and in menu names, and other places.
-$ReleaseYear = 2016;
+$ReleaseYear = 2017;
# users can upgrade from this year to the current year; might be the
# same as the release year, or any number of releases earlier.
diff --git a/Build/source/texk/tests/TeXLive/TLUtils.pm b/Build/source/texk/tests/TeXLive/TLUtils.pm
index 8876057f73a..36d440344be 100644
--- a/Build/source/texk/tests/TeXLive/TLUtils.pm
+++ b/Build/source/texk/tests/TeXLive/TLUtils.pm
@@ -5,7 +5,7 @@
package TeXLive::TLUtils;
-my $svnrev = '$Revision: 42254 $';
+my $svnrev = '$Revision: 43793 $';
my $_modulerevision = ($svnrev =~ m/: ([0-9]+) /) ? $1 : "unknown";
sub module_revision { return $_modulerevision; }
@@ -96,6 +96,7 @@ C<TeXLive::TLUtils> -- utilities used in TeX Live infrastructure
TeXLive::TLUtils::report_tlpdb_differences(\%ret);
TeXLive::TLUtils::tlnet_disabled_packages($root);
TeXLive::TLUtils::mktexupd();
+ TeXLive::TLUtils::setup_sys_user_mode($optsref,$tmfc, $tmfsc, $tmfv, $tmfsv);
=head1 DESCRIPTION
@@ -179,6 +180,7 @@ BEGIN {
&report_tlpdb_differences
&setup_persistent_downloads
&mktexupd
+ &setup_sys_user_mode
&nulldev
&get_full_line
&sort_archs
@@ -3979,6 +3981,56 @@ sub mktexupd {
return $hash;
}
+
+=item C<check_sys_user_mode($user,$sys,$tmfc, $tmfsc, $tmfv, $tmfsv)>
+
+=cut
+
+sub setup_sys_user_mode {
+ my ($prg, $optsref, $TEXMFCONFIG, $TEXMFSYSCONFIG,
+ $TEXMFVAR, $TEXMFSYSVAR) = @_;
+
+ if ($optsref->{'user'} && $optsref->{'sys'}) {
+ print STDERR "$prg [ERROR]: only one of -user and -sys can be used.\n";
+ exit(1);
+ }
+
+ # check if we are in *hidden* sys mode, in which case we switch
+ # to sys mode
+ # Nowdays we use -sys switch instead of simply overriding TEXMFVAR
+ # and TEXMFCONFIG
+ # This is used to warn users when they run updmap in usermode the first time.
+ # But it might happen that this script is called via another wrapper that
+ # sets TEXMFCONFIG and TEXMFVAR, and does not pass on the -sys option.
+ # for this case we check whether the SYS and non-SYS variants agree,
+ # and if, then switch to sys mode (with a warning)
+ if (($TEXMFSYSCONFIG eq $TEXMFCONFIG) && ($TEXMFSYSVAR eq $TEXMFVAR)) {
+ if ($optsref->{'user'}) {
+ print STDERR "$prg [ERROR]: -user mode but path setup is -sys type, bailing out.\n";
+ exit(1);
+ }
+ if (!$optsref->{'sys'}) {
+ print STDERR "$prg [WARNING]: hidden sys mode found, switching to sys mode.\n" if (!$optsref->{'quiet'});
+ $optsref->{'sys'} = 1;
+ }
+ }
+
+ my ($texmfconfig, $texmfvar);
+ if ($optsref->{'sys'}) {
+ # we are running as updmap-sys, make sure that the right tree is used
+ $texmfconfig = $TEXMFSYSCONFIG;
+ $texmfvar = $TEXMFSYSVAR;
+ } elsif ($optsref->{'user'}) {
+ $texmfconfig = $TEXMFCONFIG;
+ $texmfvar = $TEXMFVAR;
+ } else {
+ print STDERR "$prg [ERROR]: Either -user or -sys mode is required.\n" .
+ "See $TeXLive::TLConfig::SYSUSERURL for details!\n";
+ exit(1);
+ }
+ return ($texmfconfig, $texmfvar);
+}
+
=back
=cut
1;
diff --git a/Build/source/texk/texlive/linked_scripts/texlive/fmtutil.pl b/Build/source/texk/texlive/linked_scripts/texlive/fmtutil.pl
index 89eccc5ca01..fd0232b7c2b 100755
--- a/Build/source/texk/texlive/linked_scripts/texlive/fmtutil.pl
+++ b/Build/source/texk/texlive/linked_scripts/texlive/fmtutil.pl
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# $Id: fmtutil.pl 43628 2017-03-28 17:55:13Z karl $
+# $Id: fmtutil.pl 43794 2017-04-15 00:12:54Z preining $
# fmtutil - utility to maintain format files.
# (Maintained in TeX Live:Master/texmf-dist/scripts/texlive.)
#
@@ -24,11 +24,11 @@ BEGIN {
TeX::Update->import();
}
-my $svnid = '$Id: fmtutil.pl 43628 2017-03-28 17:55:13Z karl $';
-my $lastchdate = '$Date: 2017-03-28 19:55:13 +0200 (Tue, 28 Mar 2017) $';
+my $svnid = '$Id: fmtutil.pl 43794 2017-04-15 00:12:54Z preining $';
+my $lastchdate = '$Date: 2017-04-15 02:12:54 +0200 (Sat, 15 Apr 2017) $';
$lastchdate =~ s/^\$Date:\s*//;
$lastchdate =~ s/ \(.*$//;
-my $svnrev = '$Revision: 43628 $';
+my $svnrev = '$Revision: 43794 $';
$svnrev =~ s/^\$Revision:\s*//;
$svnrev =~ s/\s*\$$//;
my $version = "r$svnrev ($lastchdate)";
@@ -112,6 +112,7 @@ my @cmdline_cmds = ( # in same order as help message
our @cmdline_options = ( # in same order as help message
"sys",
+ "user",
"cnffile=s@",
"fmtdir=s",
"no-engine-subdir",
@@ -151,6 +152,12 @@ sub main {
# first generated filename after successful generation to stdout then
# (and nothing else), since kpathsea can only deal with one.
$mktexfmtMode = 1;
+
+ # TODO TODO
+ # which mode are we running in?
+ # what happens if root runs mktexfmt?
+ $opts{'user'} = 1;
+
GetOptions ( "help" => \$opts{'help'}, "version" => \$opts{'version'} )
or die "Unknown option in mktexfmt command line arguments\n";
if ($ARGV[0]) {
@@ -198,7 +205,10 @@ sub main {
}
# these two functions should go to TLUtils (for use in updmap)
- check_hidden_sysmode();
+ ($texmfconfig, $texmfvar) =
+ TeXLive::TLUtils::setup_sys_user_mode($prg, \%opts,
+ $TEXMFCONFIG, $TEXMFSYSCONFIG, $TEXMFVAR, $TEXMFSYSVAR);
+
determine_config_files("fmtutil.cnf");
my $changes_config_file = $alldata->{'changes_config'};
# we do changes always in the used config file with the highest priority
@@ -964,32 +974,6 @@ sub read_fmtutil_file {
# and also be reused in updmap.pl!!!
-sub check_hidden_sysmode {
- #
- # check if we are in *hidden* sys mode, in which case we switch
- # to sys mode
- # Nowdays we use -sys switch instead of simply overriding TEXMFVAR
- # and TEXMFCONFIG
- # This is used to warn users when they run updmap in usermode the first time.
- # But it might happen that this script is called via another wrapper that
- # sets TEXMFCONFIG and TEXMFVAR, and does not pass on the -sys option.
- # for this case we check whether the SYS and non-SYS variants agree,
- # and if, then switch to sys mode (with a warning)
- if (($TEXMFSYSCONFIG eq $TEXMFCONFIG) && ($TEXMFSYSVAR eq $TEXMFVAR)) {
- if (!$opts{'sys'}) {
- print_warning("hidden sys mode found, switching to sys mode.\n");
- $opts{'sys'} = 1;
- }
- }
-
- if ($opts{'sys'}) {
- # we are running as updmap-sys, make sure that the right tree is used
- $texmfconfig = $TEXMFSYSCONFIG;
- $texmfvar = $TEXMFSYSVAR;
- }
-}
-
-
# sets global $alldata->{'changes_config'} to the config file to be
# changed if requested.
#
@@ -1264,9 +1248,10 @@ sub version {
sub help {
my $usage = <<"EOF";
-Usage: $prg [OPTION] ... [COMMAND]
- or: $prg-sys [OPTION] ... [COMMAND]
- or: mktexfmt FORMAT.fmt|BASE.base|FMTNAME.EXT
+Usage: $prg [-user|-sys] [OPTION] ... [COMMAND]
+ or: $prg-sys [OPTION] ... [COMMAND]
+ or: $prg-user [OPTION] ... [COMMAND]
+ or: mktexfmt FORMAT.fmt|BASE.base|FMTNAME.EXT
Rebuild and manage TeX fmts and Metafont bases, collectively called
"formats" here. (MetaPost no longer uses the past-equivalent "mems".)
@@ -1285,7 +1270,8 @@ By default, the return status is zero if all formats requested are
successfully built, else nonzero.
Options:
- --sys use TEXMFSYS{VAR,CONFIG} instead of TEXMF{VAR,CONFIG}
+ --sys use TEXMFSYS{VAR,CONFIG}
+ --user use TEXMF{VAR,CONFIG}
--cnffile FILE read FILE instead of fmtutil.cnf
(can be given multiple times, in which case
all the files are used)
@@ -1341,7 +1327,7 @@ Explanation of trees and files normally used:
TEXMFLOCAL \$TEXLIVE/texmf-local/web2c/fmtutil.cnf
TEXMFDIST \$TEXLIVE/YYYY/texmf-dist/web2c/fmtutil.cnf
- For fmtutil:
+ For fmtutil-user:
TEXMFCONFIG \$HOME/.texliveYYYY/texmf-config/web2c/fmtutil.cnf
TEXMFVAR \$HOME/.texliveYYYY/texmf-var/web2c/fmtutil.cnf
TEXMFHOME \$HOME/texmf/web2c/fmtutil.cnf
@@ -1409,12 +1395,14 @@ Disabling formats:
--no-error-if-no-engine option exists, since luajittex cannot be
compiled on all platforms.)
-fmtutil vs. fmtutil-sys (fmtutil --sys):
+fmtutil-user (fmtutil -user) vs. fmtutil-sys (fmtutil -sys):
- When fmtutil-sys is run or the command line option --sys is used,
+ When fmtutil-sys is run or the command line option -sys is used,
TEXMFSYSCONFIG and TEXMFSYSVAR are used instead of TEXMFCONFIG and
TEXMFVAR, respectively. This is the primary difference between
- fmtutil-sys and fmtutil.
+ fmtutil-sys and fmtutil-user.
+
+ See http://tug.org/texlive/scripts-sys-user.html for details.
Other locations may be used if you give them on the command line, or
these trees don't exist, or you are not using the original TeX Live.
diff --git a/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl b/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
index 0afba48116b..6a79657c531 100755
--- a/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
+++ b/Build/source/texk/texlive/linked_scripts/texlive/tlmgr.pl
@@ -1,13 +1,13 @@
#!/usr/bin/env perl
-# $Id: tlmgr.pl 43566 2017-03-21 17:08:03Z karl $
+# $Id: tlmgr.pl 43803 2017-04-15 00:15:00Z preining $
#
# Copyright 2008-2017 Norbert Preining
# This file is licensed under the GNU General Public License version 2
# or any later version.
#
-my $svnrev = '$Revision: 43566 $';
-my $datrev = '$Date: 2017-03-21 18:08:03 +0100 (Tue, 21 Mar 2017) $';
+my $svnrev = '$Revision: 43803 $';
+my $datrev = '$Date: 2017-04-15 02:15:00 +0200 (Sat, 15 Apr 2017) $';
my $tlmgrrevision;
my $prg;
if ($svnrev =~ m/: ([0-9]+) /) {
@@ -307,6 +307,9 @@ my %action_specification = (
"run-post" => 1,
"function" => \&action_search
},
+ "shell" => {
+ "function" => \&action_shell
+ },
"uninstall" => {
"options" => { "force" => 1 },
"run-post" => 0,
@@ -592,8 +595,8 @@ for the full story.\n";
#
# Try to open the packagelog file, but do NOT die when that does not work
if (!open(PACKAGELOG, ">>$packagelogfile")) {
- debug("Cannot open package log file $packagelogfile for appending\n");
- debug("Will not log package installation/removal/update for that run\n");
+ tlwarn("Cannot open package log file $packagelogfile for appending\n");
+ tlwarn("Will not log package installation/removal/update for that run\n");
$packagelogfile = "";
}
@@ -627,6 +630,12 @@ for the full story.\n";
my $ret = execute_action($action, @ARGV);
+ # close the special log file
+ if ($packagelogfile && !$::gui_mode) {
+ info("$prg: package log updated: $packagelogfile\n") if $packagelogged;
+ close(PACKAGELOG);
+ }
+
# F_ERROR stops processing immediately, and prevents postactions from
# being run (e.g., untar fails). F_WARNING continues on, including
# postactions (e.g., user tries to install 10 packages and the
@@ -715,12 +724,6 @@ sub execute_action {
$run_post = 0;
}
- # close the special log file
- if ($packagelogfile && !$::gui_mode) {
- info("$prg: package log updated: $packagelogfile\n") if $packagelogged;
- close(PACKAGELOG);
- }
-
return ($ret) if (!$run_post);
# run external programs.
@@ -6495,7 +6498,208 @@ sub check_on_writable {
}
return 1;
}
-
+
+
+###########
+# tlmgr shell code
+sub action_shell {
+ my $protocol = 1;
+ our $promptfunc;
+
+ eval {
+ require IO::Prompter;
+ };
+ if ($@) {
+ printf STDERR "Cannot find IO::Prompter module, reduced interactive functionality!\n";
+ $promptfunc = sub {
+ my $default_prompt = "tlmgr>";
+ my $prompt = "";
+ my @options;
+ my @guarantee;
+ my @savedargs = @_;
+ while (defined(my $arg = shift @_)) {
+ if ($arg =~ m/^-prompt$/) {
+ $prompt .= shift @_;
+ } elsif ($arg =~ m/^-style$/) {
+ # ignore style here
+ shift @_;
+ } elsif ($arg =~ m/^-menu$/) {
+ my $options = shift @_;
+ @options = @$options;
+ } elsif ($arg =~ m/^-guarantee$/) {
+ my $guarantee = shift @_;
+ @guarantee = @$guarantee;
+ } elsif ($arg =~ m/^-/) {
+ print "ERROR unsupported prompt command, please report: $arg!\n";
+ } else {
+ $prompt .= $arg;
+ }
+ }
+ $prompt = ($prompt ? $prompt : $default_prompt );
+ print "$prompt ";
+ if (@options) {
+ print "(", join(",", @options), ") ";
+ }
+ my $ans = <STDIN>;
+ if (!defined($ans)) {
+ # we got Ctrl-D, just break out
+ return;
+ }
+ chomp($ans);
+ if (@guarantee) {
+ my $isok = 0;
+ for my $g (@guarantee) {
+ if ($ans eq $g) {
+ $isok = 1;
+ last;
+ }
+ }
+ if (!$isok) {
+ print("Please answer one of @guarantee!\n");
+ return($promptfunc->(@savedargs));
+ }
+ }
+ return($ans);
+ }
+ } else {
+ $promptfunc = \&IO::Prompter::prompt;
+ }
+ sub do_prompt {
+ our $promptfunc;
+ my $foo = $promptfunc->(@_);
+ return($foo);
+ }
+
+ print "protocol $protocol\n";
+ while (1) {
+ # print $prompt;
+ # my $ans = <STDIN>;
+ my $ans = do_prompt('tlmgr>');
+ # chomp $ans;
+ next if (!defined($ans));
+ my ($cmd, @args) = TeXLive::TLUtils::quotewords('\s+', 0, $ans);
+ next if (!defined($cmd));
+ if ($cmd eq "protocol") {
+ print "protocol $protocol\n";
+ } elsif ($cmd eq "version") {
+ print give_version(), "\n";
+ } elsif ($cmd =~ m/^(quit|end|byebye)$/i) {
+ return $F_OK;
+ } elsif ($cmd eq "setup-location") {
+ my $dest = shift @args;
+ print "ERROR not implemented: $cmd\n";
+ } elsif ($cmd =~ m/^(set|get)$/) {
+ my @valid_keys = qw/repository debug-translation machine-readable no-execute-actions require-verification verify-downloads/;
+ my $key = shift @args;
+ my $val = shift @args;
+ if (!$key) {
+ $key = do_prompt('Choose...', -menu => \@valid_keys, '>');
+ }
+ if (!$key) {
+ print("ERROR missing argument for get\n");
+ next;
+ }
+ if ($cmd eq "get" && defined($val)) {
+ print("ERROR no argument allowed for get\n");
+ next;
+ }
+ if ($cmd eq "set" && !defined($val)) {
+ if ($key eq "repository") {
+ $val = do_prompt('Enter repository:');
+ } else {
+ $val = do_prompt('Enter 1 for on, 0 for off:', -guarantee => [0,1]);
+ }
+ # deal with Ctrl-D
+ if (!defined($val)) {
+ print('ERROR Missing value for set.\n');
+ next;
+ }
+ }
+
+ if ($key eq "repository") {
+ if ($cmd eq "set") {
+ $location = scalar($val);
+ } else {
+ if (defined($location)) {
+ print "repository = $location\n";
+ } else {
+ print "repository = <UNDEFINED>\n";
+ }
+ }
+ print "OK\n";
+ } elsif ($key =~ m/^(debug-translation|machine-readable|no-execute-actions|require-verification|verify-downloads)$/i) {
+ if ($cmd eq "set") {
+ $opts{$key} = ($val eq "1" ? 1 : 0); ### THIS DOES NOT WORK??? TODO TODO
+ # special cases
+ $::debug_translation = $opts{"debug-translation"};
+ $::machinereadable = $opts{"machine-readable"};
+ $::no_execute_actions = $opts{'no-execute-actions'};
+ } else {
+ print "$key = ", ($opts{$key} ? 1 : 0), "\n";
+ }
+ print "OK\n";
+ } else {
+ print "ERROR unknown key $key\n";
+ }
+ } elsif ($cmd eq "load") {
+ my $what = shift @args;
+ if (!defined($what)) {
+ $what = do_prompt("Choose...", -menu => ['local', 'remote'], '>');
+ }
+ if ($what eq "local") {
+ init_local_db();
+ print "OK\n";
+ } elsif ($what eq "remote") {
+ init_tlmedia_or_die();
+ print "OK\n";
+ } else {
+ print "ERROR can only load 'local' or 'remote'\n";
+ }
+ } elsif ($cmd eq "save") {
+ $localtlpdb->save;
+ print "OK\n";
+ } elsif (defined($action_specification{$cmd})) {
+ # an action
+ if (!defined($action_specification{$cmd}{"function"})) {
+ print "ERROR action function not defined\n";
+ next;
+ }
+ # redo the option parsing
+ my %optarg;
+ if (defined($action_specification{$cmd}{'options'})) {
+ my %actopts = %{$action_specification{$cmd}{'options'}};
+ for my $k (keys %actopts) {
+ if ($actopts{$k} eq "1") {
+ $optarg{$k} = 1;
+ } else {
+ $optarg{"$k" . $actopts{$k}} = 1;
+ }
+ }
+ }
+ # save command line options for later restart, if necessary
+ @ARGV = @args;
+ my %savedopts = %opts;
+ %opts = ();
+ if (!GetOptions(\%opts, keys(%optarg))) {
+ print "ERROR unsupported arguments\n";
+ next;
+ }
+ my $ret = execute_action($cmd, @ARGV);
+ if ($ret & $F_ERROR) {
+ print "ERROR\n";
+ } elsif ($ret & $F_WARNING) {
+ print "OK\n";
+ } else {
+ print "OK\n";
+ }
+ %opts = %savedopts;
+ } else {
+ print "ERROR unknown command\n";
+ }
+ }
+}
+
+
1;
__END__
@@ -7545,6 +7749,11 @@ C<tables> (unless they also contain the word C<table> on its own).
=back
+=head2 shell
+
+Starts the TeX Live Manager Shell.
+
+
=head2 uninstall
Uninstalls the entire TeX Live installation. Options:
diff --git a/Build/source/texk/texlive/linked_scripts/texlive/updmap.pl b/Build/source/texk/texlive/linked_scripts/texlive/updmap.pl
index b027a0fe225..e7cadcfc0d4 100755
--- a/Build/source/texk/texlive/linked_scripts/texlive/updmap.pl
+++ b/Build/source/texk/texlive/linked_scripts/texlive/updmap.pl
@@ -1,5 +1,5 @@
#!/usr/bin/env perl
-# $Id: updmap.pl 43628 2017-03-28 17:55:13Z karl $
+# $Id: updmap.pl 43794 2017-04-15 00:12:54Z preining $
# updmap - maintain map files for outline fonts.
# (Maintained in TeX Live:Master/texmf-dist/scripts/texlive.)
#
@@ -14,7 +14,7 @@
# the original versions were licensed under the following agreement:
# Anyone may freely use, modify, and/or distribute this file, without
-my $svnid = '$Id: updmap.pl 43628 2017-03-28 17:55:13Z karl $';
+my $svnid = '$Id: updmap.pl 43794 2017-04-15 00:12:54Z preining $';
my $TEXMFROOT;
BEGIN {
@@ -27,10 +27,10 @@ BEGIN {
unshift(@INC, "$TEXMFROOT/tlpkg");
}
-my $lastchdate = '$Date: 2017-03-28 19:55:13 +0200 (Tue, 28 Mar 2017) $';
+my $lastchdate = '$Date: 2017-04-15 02:12:54 +0200 (Sat, 15 Apr 2017) $';
$lastchdate =~ s/^\$Date:\s*//;
$lastchdate =~ s/ \(.*$//;
-my $svnrev = '$Revision: 43628 $';
+my $svnrev = '$Revision: 43794 $';
$svnrev =~ s/^\$Revision:\s*//;
$svnrev =~ s/\s*\$$//;
my $version = "r$svnrev ($lastchdate)";
@@ -73,6 +73,7 @@ my $updLSR;
my @cmdline_options = (
"sys",
+ "user",
"listfiles",
"cnffile=s@",
"copy",
@@ -172,27 +173,9 @@ sub main {
exit (0);
}
- # check if we are in *hidden* sys mode, in which case we switch
- # to sys mode
- # Nowdays we use -sys switch instead of simply overriding TEXMFVAR
- # and TEXMFCONFIG
- # This is used to warn users when they run updmap in usermode the first time.
- # But it might happen that this script is called via another wrapper that
- # sets TEXMFCONFIG and TEXMFVAR, and does not pass on the -sys option.
- # for this case we check whether the SYS and non-SYS variants agree,
- # and if, then switch to sys mode (with a warning)
- if (($TEXMFSYSCONFIG eq $TEXMFCONFIG) && ($TEXMFSYSVAR eq $TEXMFVAR)) {
- if (!$opts{'sys'}) {
- print_warning("hidden sys mode found, switching to sys mode.\n");
- $opts{'sys'} = 1;
- }
- }
-
- if ($opts{'sys'}) {
- # we are running as updmap-sys, make sure that the right tree is used
- $texmfconfig = $TEXMFSYSCONFIG;
- $texmfvar = $TEXMFSYSVAR;
- }
+ ($texmfconfig, $texmfvar) =
+ TeXLive::TLUtils::setup_sys_user_mode($prg, \%opts,
+ $TEXMFCONFIG, $TEXMFSYSCONFIG, $TEXMFVAR, $TEXMFSYSVAR);
if ($opts{'dvipdfmoutputdir'} && !defined($opts{'dvipdfmxoutputdir'})) {
$opts{'dvipdfmxoutputdir'} = $opts{'dvipdfmoutputdir'};
@@ -1342,15 +1325,17 @@ sub mkMaps {
print_and_log("
WARNING: you are switching to updmap's per-user mappings.
-You have run updmap (as opposed to updmap-sys) for the first time; this
+You have run updmap-user (as opposed to updmap-sys) for the first time; this
has created configuration files which are local to your personal account.
Any changes in system map files will *not* be automatically reflected in
your files; furthermore, running updmap-sys will no longer have any
-effect for you. As a consequence, you have to rerun updmap yourself
+effect for you. As a consequence, you have to rerun updmap-user yourself
after any change in the system directories; for example, if a new font
package is added.
+See http://tug.org/texlive/scripts-sys-user.html for details.
+
If you want to undo this, remove the files mentioned above.
(Run $prg --help for full documentation of updmap.)
@@ -2240,8 +2225,9 @@ sub version {
sub help {
my $usage = <<"EOF";
-Usage: $prg [OPTION] ... [COMMAND]
- or: $prg-sys [OPTION] ... [COMMAND]
+Usage: $prg [-user|-sys] [OPTION] ... [COMMAND]
+ or: $prg-user [OPTION] ... [COMMAND]
+ or: $prg-sys [OPTION] ... [COMMAND]
Update the default font map files used by pdftex (pdftex.map), dvips
(psfonts.map), and dvipdfm(x), and optionally pxdvi, as determined by
@@ -2252,12 +2238,15 @@ Among other things, these map files are used to determine which fonts
should be used as bitmaps and which as outlines, and to determine which
font files are included, typically subsetted, in the PDF or PostScript output.
-updmap-sys is intended to affect the system-wide configuration, while
-updmap affects personal configuration files only, overriding the system
-files. As a consequence, once updmap has been run, even a single time,
+updmap-sys (or updmap -sys) is intended to affect the system-wide
+configuration, while updmap-user (or updmap -user) affects personal
+configuration files only, overriding the system files.
+As a consequence, once updmap-user has been run, even a single time,
running updmap-sys no longer has any effect. (updmap-sys issues a
warning in this situation.)
+See http://tug.org/texlive/scripts-sys-user.html for details.
+
By default, the TeX filename database (ls-R) is also updated.
The updmap system is regrettably complicated, for both inherent and
@@ -2289,6 +2278,7 @@ Options:
--nomkmap do not recreate map files
--nohash do not run texhash
--sys affect system-wide files (equivalent to updmap-sys)
+ --user affect personal files (equivalent to updmap-user)
-n, --dry-run only show the configuration, no output
--quiet, --silent reduce verbosity
@@ -2323,7 +2313,7 @@ The main output:
only and are not like other map files. dvipdfmx reads pdftex.map for
the map entries for non-Kanji fonts.
- If no option is given, so the invocation is just "updmap" or
+ If no option is given, so the invocation is just "updmap-user" or
"updmap-sys", these output files are always recreated.
Otherwise, if an option such as --enable or --disable is given, the
@@ -2402,7 +2392,7 @@ Explanation of trees and files normally used:
TEXMFLOCAL \$TEXLIVE/texmf-local/web2c/updmap.cfg
TEXMFDIST \$TEXLIVE/YYYY/texmf-dist/web2c/updmap.cfg
- For updmap:
+ For updmap-user:
TEXMFCONFIG \$HOME/.texliveYYYY/texmf-config/web2c/updmap.cfg
TEXMFVAR \$HOME/.texliveYYYY/texmf-var/web2c/updmap.cfg
TEXMFHOME \$HOME/texmf/web2c/updmap.cfg
@@ -2484,11 +2474,11 @@ Listing of maps:
(again separated by tab) containing '(not available)' for those
map files that cannot be found.
-updmap vs. updmap-sys:
+updmap-user vs. updmap-sys:
When updmap-sys is run, TEXMFSYSCONFIG and TEXMFSYSVAR are used
instead of TEXMFCONFIG and TEXMFVAR, respectively. This is the
- primary difference between updmap-sys and updmap.
+ primary difference between updmap-sys and updmap-user.
Other locations may be used if you give them on the command line, or
these trees don't exist, or you are not using the original TeX Live.