texlive[44190] Master: TLUtils::prepend_own_path adds TL bindir
commits+preining at tug.org
commits+preining at tug.org
Thu May 4 23:38:44 CEST 2017
Revision: 44190
http://tug.org/svn/texlive?view=revision&revision=44190
Author: preining
Date: 2017-05-04 23:38:43 +0200 (Thu, 04 May 2017)
Log Message:
-----------
TLUtils::prepend_own_path adds TL bindir location to PATH, use in fmtutil
Modified Paths:
--------------
trunk/Master/texmf-dist/scripts/texlive/fmtutil.pl
trunk/Master/tlpkg/TeXLive/TLUtils.pm
Modified: trunk/Master/texmf-dist/scripts/texlive/fmtutil.pl
===================================================================
--- trunk/Master/texmf-dist/scripts/texlive/fmtutil.pl 2017-05-04 17:31:52 UTC (rev 44189)
+++ trunk/Master/texmf-dist/scripts/texlive/fmtutil.pl 2017-05-04 21:38:43 UTC (rev 44190)
@@ -62,6 +62,9 @@
(our $prg = basename($0)) =~ s/\.pl$//;
+# make sure that the main binary path is available at the front
+TeXLive::TLUtils::prepend_own_path();
+
# sudo sometimes does not reset the home dir of root, check on that
# see more comments at the definition of the function itself
# this function checks by itself whether it is running on windows or not
Modified: trunk/Master/tlpkg/TeXLive/TLUtils.pm
===================================================================
--- trunk/Master/tlpkg/TeXLive/TLUtils.pm 2017-05-04 17:31:52 UTC (rev 44189)
+++ trunk/Master/tlpkg/TeXLive/TLUtils.pm 2017-05-04 21:38:43 UTC (rev 44190)
@@ -98,6 +98,7 @@
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 @@
&setup_persistent_downloads
&mktexupd
&setup_sys_user_mode
+ &prepend_own_path
&nulldev
&get_full_line
&sort_archs
@@ -4062,6 +4064,23 @@
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;
More information about the tex-live-commits
mailing list