summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2017-05-04 21:38:43 +0000
committerNorbert Preining <preining@logic.at>2017-05-04 21:38:43 +0000
commit33dc72094c1c719b32c7cdd39963612566ab3d92 (patch)
treef369e216442c5f8e1adb0f8a84a04b0bb2816805 /Master/tlpkg/TeXLive
parent5577fbe4bdb23bb33f1a36a7867a8a733a399c8e (diff)
TLUtils::prepend_own_path adds TL bindir location to PATH, use in fmtutil
git-svn-id: svn://tug.org/texlive/trunk@44190 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive')
-rw-r--r--Master/tlpkg/TeXLive/TLUtils.pm19
1 files changed, 19 insertions, 0 deletions
diff --git a/Master/tlpkg/TeXLive/TLUtils.pm b/Master/tlpkg/TeXLive/TLUtils.pm
index 4426d0dc026..520fb1f88bb 100644
--- a/Master/tlpkg/TeXLive/TLUtils.pm
+++ b/Master/tlpkg/TeXLive/TLUtils.pm
@@ -98,6 +98,7 @@ C<TeXLive::TLUtils> -- utilities used in TeX Live infrastructure
TeXLive::TLUtils::tlnet_disabled_packages($root);
TeXLive::TLUtils::mktexupd();
TeXLive::TLUtils::setup_sys_user_mode($optsref,$tmfc, $tmfsc, $tmfv, $tmfsv);
+ TeXLive::TLUtils::prepend_own_path();
=head1 DESCRIPTION
@@ -181,6 +182,7 @@ BEGIN {
&setup_persistent_downloads
&mktexupd
&setup_sys_user_mode
+ &prepend_own_path
&nulldev
&get_full_line
&sort_archs
@@ -4062,6 +4064,23 @@ sub setup_sys_user_mode {
return ($texmfconfig, $texmfvar);
}
+=item C<prepend_own_path()>
+
+Prepends the location of the TeX Live binaries to the PATH environment variable.
+
+=cut
+
+sub prepend_own_path {
+ my $bindir = dirname(Cwd::abs_path(which('kpsewhich')));
+ if (win32()) {
+ $bindir =~ s!\\!/!g;
+ $ENV{'PATH'} = "$bindir;$ENV{PATH}";
+ } else {
+ $ENV{'PATH'} = "$bindir:$ENV{PATH}";
+ }
+}
+
+
=back
=cut
1;