Ignore:
Timestamp:
2008-03-20T20:51:57+13:00 (16 years ago)
Author:
ak19
Message:
  1. Doesn't presume that GSDLCOLLECT env var is set. 2. Sub tmp_area_convert_file tries GSDLCOLLECT folder, else goes to GSDLHOME folder to create tmp folder in
File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/perllib/plugins/ConvertToPlug.pm

    r14928 r15116  
    110110    my $plugin_package = $plugin_class.".pm";
    111111
    112     my $colplugname = &util::filename_cat($ENV{'GSDLCOLLECTDIR'},
    113                           "perllib/plugins",
    114                           $plugin_package);
     112    my $colplugname = undef;
     113    if (defined $ENV{'GSDLCOLLECTDIR'}) {
     114        $colplugname = &util::filename_cat($ENV{'GSDLCOLLECTDIR'},
     115                           "perllib","plugins",
     116                           $plugin_package);
     117    }
     118
    115119    my $mainplugname = &util::filename_cat($ENV{'GSDLHOME'},
    116                            "perllib/plugins",
     120                           "perllib","plugins",
    117121                           $plugin_package);
    118122
    119     if (-e $colplugname) {require $colplugname;}
     123    if ((defined $colplugname) && (-e $colplugname)) { require $colplugname;}
    120124    elsif (-e $mainplugname) { require $mainplugname; }
    121125    else {
     
    256260    my $convert_to_ext = $self->{'convert_to_ext'};
    257261   
    258     # softlink to collection tmp dir
    259     my $tmp_dirname
    260     = &util::filename_cat($ENV{'GSDLCOLLECTDIR'}, "tmp");
    261     &util::mk_dir($tmp_dirname) if (!-e $tmp_dirname);
    262 
    263262    # derive tmp filename from input filename
    264263    my ($tailname, $dirname, $suffix)
    265264    = &File::Basename::fileparse($input_filename, "\\.[^\\.]+\$");
    266265
     266    # softlink to collection tmp dir
     267    my $tmp_dirname = $dirname;
     268    if(defined $ENV{'GSDLCOLLECTDIR'}) {
     269    $tmp_dirname = $ENV{'GSDLCOLLECTDIR'};
     270    } elsif(defined $ENV{'GSDLHOME'}) {
     271    $tmp_dirname = $ENV{'GSDLHOME'};
     272    }
     273    $tmp_dirname = &util::filename_cat($tmp_dirname, "tmp");
     274    &util::mk_dir($tmp_dirname) if (!-e $tmp_dirname);
     275   
    267276    # Remove any white space from filename -- no risk of name collision, and
    268277    # makes later conversion by utils simpler. Leave spaces in path...
     
    303312    }
    304313    $cmd .= "-errlog \"$errlog\" -output $output_type \"$tmp_filename\"";
    305 
    306314    $output_type = `$cmd`;
    307315
    308316    # remove symbolic link to original file
    309317    &util::rm($tmp_filename);
    310 
     318   
    311319    # Check STDERR here
    312320    chomp $output_type;
Note: See TracChangeset for help on using the changeset viewer.