diff options
author | Norbert Preining <preining@logic.at> | 2017-05-04 21:38:43 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2017-05-04 21:38:43 +0000 |
commit | 33dc72094c1c719b32c7cdd39963612566ab3d92 (patch) | |
tree | f369e216442c5f8e1adb0f8a84a04b0bb2816805 | |
parent | 5577fbe4bdb23bb33f1a36a7867a8a733a399c8e (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
-rwxr-xr-x | Master/texmf-dist/scripts/texlive/fmtutil.pl | 3 | ||||
-rw-r--r-- | Master/tlpkg/TeXLive/TLUtils.pm | 19 |
2 files changed, 22 insertions, 0 deletions
diff --git a/Master/texmf-dist/scripts/texlive/fmtutil.pl b/Master/texmf-dist/scripts/texlive/fmtutil.pl index 62e7e19b767..3e73d40849e 100755 --- a/Master/texmf-dist/scripts/texlive/fmtutil.pl +++ b/Master/texmf-dist/scripts/texlive/fmtutil.pl @@ -62,6 +62,9 @@ my @deferred_stdout; (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 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; |