From 33dc72094c1c719b32c7cdd39963612566ab3d92 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Thu, 4 May 2017 21:38:43 +0000 Subject: 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 --- Master/tlpkg/TeXLive/TLUtils.pm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'Master/tlpkg/TeXLive/TLUtils.pm') 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 -- 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 + +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; -- cgit v1.2.3