Ignore:
Timestamp:
10/06/17 18:55:29 (3 years ago)
Author:
ak19
Message:
  1. Bugfix to previous commit: var might not be on an UnknownConverterPlugin, so the regexes on shouldn't take place then. 2. Shifted to using Kathy's double percent signs denoting placeholders, tested and works still.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugins/UnknownConverterPlugin.pm

    r32026 r32028  
    118118    # It's up to the user to do the (escaped) double-quoting around paths.
    119119    my $cmd = $self->{'exec_cmd'};
    120     $cmd =~ s@%GSDL3SRCHOME@$ENV{'GSDL3SRCHOME'}@g;
    121     $cmd =~ s@%GSDLHOME@$ENV{'GSDLHOME'}@g;
    122     $cmd =~ s@%GSDL3HOME@$ENV{'GSDL3HOME'}@g;
    123     $self->{'exec_cmd'} = $cmd;
     120    if($cmd) {
     121    $cmd =~ s@%%GSDL3SRCHOME@$ENV{'GSDL3SRCHOME'}@g;
     122    $cmd =~ s@%%GSDLHOME@$ENV{'GSDLHOME'}@g;
     123    $cmd =~ s@%%GSDL3HOME@$ENV{'GSDL3HOME'}@g;
     124    $self->{'exec_cmd'} = $cmd;
     125    }
    124126   
    125127    my $secondary_plugin_name = $self->{'convert_to_plugin'};
     
    256258    # replace remaining occurrences of placeholders in cmd string, the ones that change per input file
    257259    #$cmd =~ s@\"@\\"@g;
    258     $cmd =~ s@%INPUT_FILE@\"$tmp_filename\"@g; # refer to the softlink
     260    $cmd =~ s@%%INPUT_FILE@\"$tmp_filename\"@g; # refer to the softlink
    259261    if(defined $output_dirname) {
    260     $cmd =~ s@%OUTPUT@\"$output_dirname\"@g;
     262    $cmd =~ s@%%OUTPUT@\"$output_dirname\"@g;
    261263    } else {
    262     $cmd =~ s@%OUTPUT@\"$output_filename\"@g;
     264    $cmd =~ s@%%OUTPUT@\"$output_filename\"@g;
    263265    }
    264266
Note: See TracChangeset for help on using the changeset viewer.