Changeset 501


Ignore:
Timestamp:
Sep 20, 2004, 3:59:43 PM (17 years ago)
Author:
kake
Message:

Added option of munging in custom lib paths on install.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Build.PL

    r500 r501  
    3737{ question => "What URL does the install directory map to?",
    3838  variable => "script_url",
     39  },
     40{ question => "Do you want me to munge a custom lib path into the scripts? "
     41             . "If so, enter it here.  Separate path entries with whitespace:",
     42  variable => "custom_lib_path",
    3943  },
    4044{ question => "Do you want to use Plucene for searching? (recommended, but see Changes file before saying yes to this)",
  • trunk/Changes

    r500 r501  
    44        Fixed bug in install procedure - blank script_name should now get
    55          installed as index.cgi
     6        Added option of munging in custom lib paths on install.
    67
    780.40    18 September 2004
  • trunk/INSTALL

    r500 r501  
    8181Give the full address needed to access the installation directory with
    8282a web browser - for example http://london.openguides.org/cgi-bin/
     83
     84
     85  "Do you want me to munge a custom lib path into the scripts?"
     86
     87If you have installed some or all of the required Perl modules (or indeed
     88the OpenGuides modules themselves) into a private directory, you will
     89need to tell the scripts where to find these modules.  Enter the paths
     90to search here just as you would enter them in a 'use lib qw( ... );'
     91in a Perl script.
    8392
    8493
  • trunk/TROUBLESHOOTING

    r500 r501  
    2121If any or all of the modules required by the OpenGuides scripts are in
    2222a private directory, then you'll need to tell the scripts where to find
    23 them. At present the only way to do this is to install everything and
    24 then manually edit wiki.cgi (or whatever you called it),
    25 supersearch.cgi and preferences.cgi to include a line like
    26 
    27   use lib qw( /path/to/my/modules/ );
    28 
    29 at the top before any other modules are required.
     23them. From version 0.41 of OpenGuides, you can do this at 'perl Build.PL'
     24time - see the INSTALL file included in this distribution.
    3025
    3126----------------------------------------------------------------------
  • trunk/lib/OpenGuides/Build.pm

    r500 r501  
    5757    my $script_name       = $config->{_}->{script_name};
    5858    my $template_path     = $config->{_}->{template_path};
     59    my $custom_lib_path   = $config->{_}->{custom_lib_path};
    5960    my @extra_scripts     = @{ $self->{config}{__extra_scripts} };
    6061    my @templates         = @{ $self->{config}{__templates} };
     
    7778            $self->fix_shebang_line($copy);
    7879            $self->make_executable($copy);
     80            $self->add_custom_lib_path( $copy, $custom_lib_path )
     81              if $custom_lib_path;
    7982        } else {
    8083            print "Skipping $install_directory/$script_filename (unchanged)\n";
     
    9295                $self->fix_shebang_line($copy);
    9396                $self->make_executable($copy) unless $script eq "wiki.conf";
     97                $self->add_custom_lib_path( $copy, $custom_lib_path )
     98                  if $custom_lib_path;
    9499            } else {
    95100                print "Skipping $install_directory/$script (unchanged)\n";
     
    109114}
    110115
     116sub add_custom_lib_path {
     117    my ($self, $copy, $lib_path) = @_;
     118    local $/ = undef;
     119    open my $fh, $copy or die $!;
     120    my $content = <$fh>;
     121    close $fh or die $!;
     122    $content =~ s|use strict;|use strict\;\nuse lib qw( $lib_path )\;|s;
     123    open $fh, ">$copy" or die $!;
     124    print $fh $content;
     125    close $fh or die $!;
     126    return 1;
     127}
     128
    1111291;
Note: See TracChangeset for help on using the changeset viewer.