summaryrefslogtreecommitdiff
path: root/Build/source/texk/tests
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/source/texk/tests
parenteb34bcb3c61d9f6d8e9c2b6f98e2f70db3110a84 (diff)
sync,doc
git-svn-id: svn://tug.org/texlive/trunk@43842 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/tests')
-rw-r--r--Build/source/texk/tests/TeXLive/TLConfig.pm6
-rw-r--r--Build/source/texk/tests/TeXLive/TLUtils.pm54
2 files changed, 56 insertions, 4 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;