summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPiotr Strzelczyk <piotr@eps.gda.pl>2009-06-18 20:28:13 +0000
committerPiotr Strzelczyk <piotr@eps.gda.pl>2009-06-18 20:28:13 +0000
commit3ab493861cda38e42e3fcfd886300bc45a3bfc22 (patch)
tree00e1227d9a791097ece051227d3f6c9256a83ca4
parent0f0a01bf99d44153c4854552674cab26d8f967e0 (diff)
fix for running w/o kpsewhich
git-svn-id: svn://tug.org/texlive/trunk@13826 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgr.pl22
1 files changed, 12 insertions, 10 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl
index f97c0bbf4c4..6432177bd8a 100755
--- a/Master/texmf/scripts/texlive/tlmgr.pl
+++ b/Master/texmf/scripts/texlive/tlmgr.pl
@@ -34,20 +34,22 @@ our $Master;
BEGIN {
$^W = 1;
# make subprograms (including kpsewhich) have the right path:
- $mydir = $0;
- $mydir =~ s,/[^/]*$,,;
- my $kpsewhichname;
- if (!$^O =~ /^MSWin/i) {
- $ENV{"PATH"} = "$mydir;$ENV{PATH}";
+ my $bindir, $kpsewhichname;
+ if ($^O =~ /^MSWin/i) {
+ # on win32 $0 points directly to tlmgr.pl; it can be relative
+ $Master = "$0/../../../..";
+ $bindir = "$Master/bin/win32";
$kpsewhichname = "kpsewhich.exe";
} else {
+ $bindir = $0;
+ $bindir =~ s,/*[^/]*$,,;
+ $Master = "$bindir/../..";
+ # make subprograms (including kpsewhich) have the right path:
+ $ENV{"PATH"} = "$bindir;$ENV{PATH}";
$kpsewhichname = "kpsewhich";
}
- if (! -r "$mydir/$kpsewhichname") {
- # no kpsewhich in the same directory, so we are in a bootstrapping
- # mode, use for Master $mydir/../..
- $Master = "$mydir/../..";
- } else {
+ if (-r "$bindir/$kpsewhichname") {
+ # if not in bootstrapping mode => kpsewhich exists, so use it to get $Master
chomp($Master = `kpsewhich -var-value=SELFAUTOPARENT`);
}