Changeset 38698 for main/trunk


Ignore:
Timestamp:
2024-02-06T12:58:37+13:00 (3 months ago)
Author:
davidb
Message:

Code introduced to 'paramaterize' the GSDL3SRCHOME part of files saved to .args. Motivation for this is to allow import.pl to be run on one computer, and then the colection files can be transfered to another where buildcol.pl is run

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/convertutil.pm

    r30599 r38698  
    8787{
    8888    my ($command,$options) = @_;
    89 
    9089
    9190    # $options points to a hashtable that must have fields for:
     
    234233
    235234    if (open(ARGSOUT,">$args_filename")) {
    236     print ARGSOUT $command;
     235    # for portability between Greenstone installation, substitute gsdl environment variable in $command
     236    my $gsdl3srchome = $ENV{'GSDL3SRCHOME'};
     237    my $gsdl_substitute_command = $command;
     238    $gsdl_substitute_command =~ s@$gsdl3srchome@\$GSDL3SRCHOME@g;
     239   
     240    print ARGSOUT $gsdl_substitute_command;
    237241    print ARGSOUT "\n";
    238242    close(ARGSOUT);
     
    300304        if (defined $prev_command) {
    301305        # if commands are different
    302         if ($prev_command ne $command) {
     306
     307        # but first apply the gsdl environment variable substitute, for portability
     308        my $gsdl3srchome = $ENV{'GSDL3SRCHOME'};
     309        my $gsdl_substitute_command = $command;
     310        $gsdl_substitute_command =~ s@$gsdl3srchome@\$GSDL3SRCHOME@g;
     311       
     312        if ($prev_command ne $gsdl_substitute_command) {
    303313            # need to rerun command
    304314            ($regenerated,$result,$had_error)
Note: See TracChangeset for help on using the changeset viewer.