Index: testenv =================================================================== RCS file: /cvsroot/twiki/twiki/bin/testenv,v retrieving revision 1.34 retrieving revision 1.35 diff -U3 -r1.34 -r1.35 --- testenv 17 Nov 2002 14:57:29 -0000 1.34 +++ testenv 23 Nov 2002 18:58:03 -0000 1.35 @@ -198,8 +198,16 @@ $cygwinRcsVerNum = $pkg; } } elsif ($detailedOS =~ /win/i && $detailedOS !~ /darwin/i ) { - $perltype = 'ActiveState'; - $perlver .= ", build " . Win32::BuildNumber(); # ActivePerl only + # Windows Perl - try ActivePerl-only function: returns number if + # successful, otherwise treated as a literal (bareword). + my $isActivePerl= eval 'Win32::BuildNumber !~ /Win32/'; + if( $isActivePerl ) { + $perltype = 'ActiveState'; + $perlver .= ", build " . Win32::BuildNumber(); + } else { + # Could be SiePerl or some other Win32 port of Perl + $perltype = 'SiePerl/Other Win32 Perl'; + } } else { $perltype = 'generic'; } @@ -344,12 +351,12 @@ # # Get group info my $grp = ""; -if ( $perltype ne 'ActiveState' ) { +if( $OS eq 'UNIX' or ($OS eq 'WINDOWS' and $perltype eq 'Cygwin' ) ) { foreach( split( " ", $( ) ) { # Unix/Cygwin Perl my $onegrp = getgrgid( $_ ); $grp .= " " . lc($onegrp); } -} else { # ActiveState Perl +} else { # ActiveState or other Win32 Perl # Try to use Cygwin's 'id' command - may be on the path, since Cygwin # is probably installed to supply ls, egrep, etc - if it isn't, give up. # Run command without stderr output, to avoid CGI giving error. @@ -639,26 +646,28 @@ print ""; } -# PERL5SHELL check for ActiveState Perl on Windows only -if( $OS eq 'WINDOWS' && $perltype eq 'ActiveState' ) { +# PERL5SHELL check for non-Cygwin Perl on Windows only +if( $OS eq 'WINDOWS' && $perltype ne 'Cygwin' ) { + # ActiveState or SiePerl/other my $perl5shell = $ENV{'PERL5SHELL'} || ''; print "\n"; print "
\n"; - print "To use 'bash' with ActiveState Perl, you should set the \n"; + print "To use 'bash' with ActiveState or other Win32 Perls, you should set the \n"; print "PERL5SHELL environment variable to something like c:/YOURCYGWINDIR/bin/bash.exe -c.\n"; print "This should be set in the System Environment, and ideally set \n"; print "directly in the web server (e.g. using the Apache SetEnv \n"; print "command, followed by an Apache restart). Once this is done, you should re-run testenv\n"; print "to check that PERL5SHELL is set properly.\n"; - if( Win32::BuildNumber() < $ActivePerlRecommendedBuild ) { + if ($perltype eq 'ActiveState' and + Win32::BuildNumber() < $ActivePerlRecommendedBuild ) { print "
\n"; print "Warning: "; print "ActiveState Perl must be upgraded to build $ActivePerlRecommendedBuild if you are going to use PERL5SHELL, which was broken in earlier builds.";