summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive/TLWinGoo.pm
diff options
context:
space:
mode:
authorSiep Kroonenberg <siepo@cybercomm.nl>2008-06-19 19:52:40 +0000
committerSiep Kroonenberg <siepo@cybercomm.nl>2008-06-19 19:52:40 +0000
commita29d1c3b81e693ba943ca1ccedfca84d69edd770 (patch)
treeff72717ebf42eb1865e8de55e0494c9f6e3ab591 /Master/tlpkg/TeXLive/TLWinGoo.pm
parentd6d706cf043a51dee01517b4c5275a7f227fd0ba (diff)
TLWingoo: removed wg_error; never remove system directories from
path whatever TeX programs they may contain git-svn-id: svn://tug.org/texlive/trunk@8879 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive/TLWinGoo.pm')
-rw-r--r--Master/tlpkg/TeXLive/TLWinGoo.pm56
1 files changed, 12 insertions, 44 deletions
diff --git a/Master/tlpkg/TeXLive/TLWinGoo.pm b/Master/tlpkg/TeXLive/TLWinGoo.pm
index 24e5ead4b96..593241f0d35 100644
--- a/Master/tlpkg/TeXLive/TLWinGoo.pm
+++ b/Master/tlpkg/TeXLive/TLWinGoo.pm
@@ -22,10 +22,6 @@ C<TeXLive::TLWinGoo> -- Additional utilities for Windows
use TeXLive::TLWinGoo;
-=head2 ERROR HANDLING
-
- TeXLive::TLWinGoo::wg_error;
-
=head2 DIAGNOSTICS
TeXLive::TLWinGoo::win_version;
@@ -82,7 +78,6 @@ BEGIN {
use vars qw( @ISA @EXPORT $Registry);
@ISA = qw( Exporter );
@EXPORT = qw(
- &wg_error
&win_version
&is_vista
&admin
@@ -141,31 +136,6 @@ my $is_win = $^O=~/^MSWin(32|64)$/i;
=back
-=head2 ERROR HANDLING
-
-=over 6
-
-=item C<wg_error>
-
-Returns WinGoo error status, in the shape of an array (number,
-message) and clears the error status. No error <=> error number 0
-
-=cut
-
-my $wg_error = 0;
-my $wg_error_message = "";
-
-sub wg_error {
- my @retval = ($wg_error, $wg_error_message);
- $wg_error = 0;
- $wg_error_message = "";
- return @retval;
-}
-
-=pod
-
-=back
-
=head2 DIAGNOSTICS
=over 6
@@ -332,11 +302,15 @@ sub global_tmpdir { return $global_tmp; }
sub is_a_texdir {
my $d = shift;
- #my $xd = expand_string($d);
$d =~ s/\\/\//g;
- $d =~ s/\/$//;
- my $d1 = $d . '/pdftex.exe';
- my $d2 = $d . '/tex.exe';
+ $d = $d . '/' unless $d =~ m!/$!;
+ # don't consider anything under %systemroot% a texdir
+ my $sr = uc(expand_string($ENV{'SystemRoot'}));
+ $sr =~ s/\\/\//g;
+ $sr = $sr . '/' unless $sr =~ m!/$!;
+ return 0 if index($d, $sr)==0;
+ my $d1 = $d . 'pdftex.exe';
+ my $d2 = $d . 'tex.exe';
return ((-e $d1) or (-e $d2));
}
@@ -462,14 +436,13 @@ sub unsetenv_reg {
Remove wrong TeX directories from system path (if possible) and user
path. A directory is a TeX directory if it contains tex.exe or
-pdftex.exe. Then if necessary add desired TeX directory; to system path if
-admin, otherwise to user path. wg_error gets set if there is a
-connflicting tex directory which cannot be removed from the path.
+pdftex.exe and if it is not under %systemroot%. Then if necessary
+add desired TeX directory; to system path if admin, otherwise to
+user path.
=cut
sub add_texbindir_to_path {
- $wg_error = 0; # clear error status
my $texbindir = shift;
my $system_env = get_system_env();
@@ -510,10 +483,7 @@ sub add_texbindir_to_path {
if (uc($d_exp) eq uc($texbindir)) {
$found = 1;
} elsif (is_a_texdir($d_exp)) {
- $wg_error = 1;
- $wg_error_message =
- "Warning: possibly conflicting [pdf]TeX program found at $d_exp\n";
- debug($wg_error_message);
+ debug("Warning: possibly conflicting [pdf]TeX program found at $d_exp\n");
}
}
}
@@ -555,7 +525,6 @@ system path.
=cut
sub remove_texbindirs_from_path {
- $wg_error = 0; # clear error status
my $system_env = get_system_env();
my $user_env = get_user_env();
@@ -773,7 +742,6 @@ sub broadcast_env() {
use constant WM_SETTINGCHANGE => 0x001A;
my $result = "";
my $SendMessage;
- $wg_error = 0;
debug("Broadcasting \"Enviroment settings changed\" message...\n");
$SendMessage = new Win32::API('user32', 'SendMessage', 'LLPP', 'L');
$result = $SendMessage->Call(HWND_BROADCAST, WM_SETTINGCHANGE,