You are here: Foswiki>Tasks Web>Item428 (05 Mar 2010, MartinCleaver)Edit Attach
I thought I'd already checked this in, but...

The following patch informs TWiki of whether it is running under IndigoPerl; it simply changes perlType. I wanted this in because I wanted TWiki to pick up the set of paths most appropriate to an IndigoPerl install. IndigoPerl is a bundle of Perl 5.8, Apache and mod_perl so there is almost no configuration on a Windows box: once you know you are on IndigoPerl everything is in a standard place. This is a useful diagnostic in itself but is also a key enabler for TWiki:Codev.PlatformDefaults.

MC

Index: bin/configure
===================================================================
--- bin/configure       (revision 6478)
+++ bin/configure       (working copy)
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -w
+#!/usr/bin/perl -w
 #
 # TWiki Collaboration Platform, http://TWiki.org/
 #
@@ -1416,12 +1416,15 @@
             $cygwinRcsVerNum = $pkg;
         }
     } elsif ($TWiki::cfg{DetailedOS} =~ /win/i && $TWiki::cfg{DetailedOS} !~ /d
arwin/i ) {
-        # 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';
-            $perlverMsg = $perlver . ", build " . Win32::BuildNumber();
+     # Windows Perl - try detecting which by trying Win32 only function:
+     # returns number if successful, otherwise treated as a literal (bareword).

+     my $win32buildNumber = eval 'Win32::BuildNumber !~ /Win32/';
+     if( $win32buildNumber ) {
+          if ($Config::Config{ldflags} =~ m/indigoperl/i) {
+                   $perltype = 'IndigoPerl';
+           } else {
+             $perltype = 'ActiveState';
+           }
         } else {
             # Could be SiePerl or some other Win32 port of Perl
             $perltype = 'SiePerl or other Windows Perl';


Question; what's the short-term value of this? You are not switching on perltype==indigoperl anywhere, and AFAICT from reading the code the only difference this would make is that it would announce it was indigoperl instead of 'generic'.

Oh, and one thing you need to do is check that IndigoPerl supports safe pipes. Otherwise a public server using it is wide open to hacking.

CC

IndigoPerl uses the same code as ActiveState. The only difference is that it is bundled with Apache + ModPerl.

I'd prefer to apply than defer this

MC

  1. Why do you need to be able to identify it?
  2. Does it support safe pipes?

CC

IndigoPerl needs a different set of defaults, minimally someone needs to be pointed to the right page on TWiki.org to manully find the right defaults. Optimally we could detect the environment and automatically switch to the right set.

Indy tells me that it is the same code base as ActiveStatePerl. If that supports safepipes then so does IndigoPerl.

Who can we ask?

MC

http://aspn.activestate.com/ASPN/docs/ActivePerl/5.8/lib/Pod/perlipc.html#safe_pipe_opens says that they are (should) be supported.

MC

Undeferred, post Dakar CC

martin, is this still needed? i believe all windows versions (cygwin, activestate, indigo, strawberry, etc(?)) have reasonable defaults now.

-- WillNorris - 13 May 2009

additionally, don't we currently recommend strawberry perl instead of indigo perl, making this kind of irrelevant?

-- WillNorris - 13 May 2009

Fair enough. And as I recommend Macs and Linux over Windows I actually no longer care whatsoever wink

-- MartinCleaver - 05 Mar 2010

ItemTemplate edit

Summary Code to distinguish between ActiveStatePerl and IndigoPerl
ReportedBy MartinCleaver
Codebase
SVN Range
AppliesTo Engine
Component
Priority Enhancement
CurrentState No Action Required
WaitingFor MartinCleaver
Checkins
TargetRelease patch
ReleasedIn
Topic revision: r15 - 05 Mar 2010, MartinCleaver
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy