Changeset 134 for trunk/gsdl/perllib


Ignore:
Timestamp:
1999-02-02T22:59:06+13:00 (25 years ago)
Author:
rjmcnab
Message:

Used GSDLCOLLECTDIR which is now defined in util.pm.

Location:
trunk/gsdl/perllib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/docsave.pm

    r98 r134  
    2121    $self->{'archive_info'} = $archive_info;
    2222
     23    # set a default for the archive directory
     24    $self->{'archive_dir'} = "$ENV{'GSDLHOME'}/collect/$self->{'collection'}/archives";
     25
    2326    return bless $self, $class;
     27}
     28
     29sub setarchivedir {
     30    my $self = shift (@_);
     31    my ($archive_dir) = @_;
     32
     33    $self->{'archive_dir'} = $archive_dir;
    2434}
    2535
     
    2838    my ($doc_obj) = @_;
    2939
    30     my $archive_dir = "$ENV{'GSDLHOME'}/collect/$self->{'collection'}/archives";
     40    my $archive_dir = $self->{'archive_dir'};
    3141    my $OID = $doc_obj->get_OID();
    3242    $OID = "NULL" unless defined $OID;
     
    3949    # same one.
    4050    $doc_dir = $doc_info->[0];
     51    $doc_dir =~ s/\/?doc\.gml$//;
    4152
    4253    } else {
  • trunk/gsdl/perllib/mgbuilder.pm

    r98 r134  
    3434
    3535    # read in the collection configuration file
    36     if (!-e "$ENV{'GSDLHOME'}/collect/$collection/etc/collect.cfg") {
     36    if (!-e "$ENV{'GSDLCOLLECTDIR'}/etc/collect.cfg") {
    3737    die "mgbuilder::new - couldn't find collect.cfg for collection $collection\n";
    3838    }
     
    7171    # otherwise, use the mg buildproc
    7272    my ($buildprocdir, $buildproctype);
    73     if (-e "$ENV{'GSDLHOME'}/collect/$collection/perllib/${collection}buildproc.pm") {
    74     $buildprocdir = "$ENV{'GSDLHOME'}/collect/$collection/perllib";
     73    if (-e "$ENV{'GSDLCOLLECTDIR'}/perllib/${collection}buildproc.pm") {
     74    $buildprocdir = "$ENV{'GSDLCOLLECTDIR'}/perllib";
    7575    $buildproctype = "${collection}buildproc";
    7676    } else {
     
    102102sub compress_text {
    103103    my $self = shift (@_);
     104    my ($textindex) = @_;
    104105    my $exedir = "$ENV{'GSDLHOME'}/bin/$ENV{'GSDLOS'}";
    105106    my $exe = &util::get_os_exe ();
     
    121122    $self->{'buildproc'}->set_output_handle ('mgbuilder::PIPEOUT');
    122123    $self->{'buildproc'}->set_mode ('text');
    123     $self->{'buildproc'}->set_index ('section:text');
     124    $self->{'buildproc'}->set_index ($textindex);
    124125   
    125126    # collect the statistics for the text
  • trunk/gsdl/perllib/plugin.pm

    r16 r134  
    33package plugin;
    44
     5require util;
    56
    67sub load_plugins {
     
    1011    foreach $plugin (@$plugin_list) {
    1112    # find the plugin
    12     if (-e "$ENV{'GSDLHOME'}/collect/$collection/perllib/plugins/${plugin}.pm") {
    13         require "$ENV{'GSDLHOME'}/collect/$collection/perllib/plugins/${plugin}.pm";
    14 
    15     } elsif (-e "$ENV{'GSDLHOME'}/perllib/plugins/${plugin}.pm") {
    16         require "$ENV{'GSDLHOME'}/perllib/plugins/${plugin}.pm";
    17 
    18     } else {
    19         die "ERROR - couldn't find plugin $plugin\n";
    20     }
     13    my $colplugname = &util::filename_cat($ENV{'GSDLCOLLECTDIR'},"perllib/plugins",
     14                          "${plugin}.pm");
     15    my $mainplugname = &util::filename_cat($ENV{'GSDLHOME'},"perllib/plugins",
     16                           "${plugin}.pm");
     17    if (-e $colplugname) { require $colplugname; }
     18    elsif (-e $mainplugname) { require $mainplugname; }
     19    else { die "ERROR - couldn't find plugin $plugin\n"; }
    2120
    2221    # create a plugin object
     
    4443    }
    4544
    46     print STDERR "WARNING - no plugin could process $base_dir$file\n";
     45    print STDERR "WARNING - no plugin could process " .
     46    &util::filename_cat($base_dir,$file) . "\n";
    4747}
    4848
Note: See TracChangeset for help on using the changeset viewer.