summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive/TLUtils.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tlpkg/TeXLive/TLUtils.pm')
-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;