Ignore:
Timestamp:
2013-04-19T18:02:41+12:00 (11 years ago)
Author:
kjdon
Message:

Because activate uses perl modules like LWP and NET and URI which may not be available in all standard perl distributions, these were recently added into CPAN by Dr Bainbridge. Along with that, cpan was added into the INC array in activate.pl. Doing so caused a conflict on the svn version of the code on Windows, where ActivePerl was installed. That perl installation had a conflict with cpan\auto folder in particular its HTML and Win32 subfolders because these are perl5.8 specific. A new cpan\perl-5.8 folder is being introduced with its own auto subfolder which will contain all these things to prevent conflicts with other versions of perl. However, cpan\auto\Image(\Size) will still remain in the top cpan\auto level since that's not part of the ActivePerl installation. As it contains only perl code and no binaries, it may not as tied down to any specific version of perl.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/bin/script/activate.pl

    r27175 r27240  
    3535# GS3 web server again if necessary.
    3636
     37use Config;
    3738
    3839BEGIN {
     
    4142    unshift (@INC, "$ENV{'GSDLHOME'}/perllib");
    4243    unshift (@INC, "$ENV{'GSDLHOME'}/perllib/cpan");
     44   
     45    # Adding cpan in, adds in its auto subfolder which conflicts with ActivePerl on Windows
     46    # The auto folder has been moved into a perl-5.8 folder, and this will now be included
     47    # only if the current version of perl is 5.8 (and not ActivePerl).
     48    my $perl_dir;
     49
     50    # Note: $] encodes the version number of perl
     51    if ($]>=5.010) {
     52        $perl_dir="perl-5.".substr($],3,2);
     53    }
     54    elsif ($]>5.008) {
     55    # perl 5.8.1 or above
     56    $perl_dir = "perl-5.8";
     57    }
     58    elsif ($]>=5.008) {
     59    # perl 5.8.1 or above
     60    $perl_dir = "perl-5.8";
     61    }
     62    elsif ($]<5.008) {
     63    # assume perl 5.6
     64    $perl_dir = "perl-5.6";
     65    }
     66    else {
     67    print STDERR "Warning: Perl 5.8.0 is not a maintained release.\n";
     68    print STDERR "         Please upgrade to a newer version of Perl.\n";
     69    $perl_dir = "perl-5.8";
     70    }
     71
     72    #if ($ENV{'GSDLOS'} !~ /^windows$/i) {
     73        # Use push to put this on the end, so an existing XML::Parser will be used by default
     74        if (-d "$ENV{'GSDLHOME'}/perllib/cpan/$perl_dir-mt" && $Config{usethreads}){
     75            push (@INC, "$ENV{'GSDLHOME'}/perllib/cpan/$perl_dir-mt");
     76        }
     77        else{
     78            push (@INC, "$ENV{'GSDLHOME'}/perllib/cpan/$perl_dir");
     79        }
     80    #}
     81   
    4382}
    4483
Note: See TracChangeset for help on using the changeset viewer.