Changeset 20539


Ignore:
Timestamp:
2009-09-07T11:42:58+12:00 (15 years ago)
Author:
davidb
Message:

Couple of tweaks to do with when caching is run for the very first time

File:
1 edited

Legend:

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

    r20343 r20539  
    268268    my $args_filename = "$ofilename.args";
    269269
    270     if (!-e $ofilename) {
     270    if ((!-e $ofilename) || (!-e $args_filename)) {
    271271    ($regenerated,$result,$had_error)
    272272        = regenerate_general_cmd($command,$ofilename,$options);
     
    302302            print $outhandle "  $message_prefix: Cached file $ofile_no_dir already exists.\n";
    303303            print $outhandle "  $message_prefix: No need to regenerate $ofile\n" if ($verbosity > 2);
    304                    
    305                     # Read in the cached result lines and join them into a single string
    306                     my $result_filename = "$ofilename.result";
    307                     if (open(RESIN, "<$result_filename"))
    308             {
    309                       my @result_lines = <RESIN>;
    310                       $result = join("\n", @result_lines);
    311                       close(RESIN);
    312                     }
    313                     else
    314             {
    315                       print $outhandle "  $message_prefix: Error, failed to obtain cached result from $result_filename.\n";
    316                     }
     304           
     305            if ((defined $options->{'cache_mode'})
     306            && $options->{'cache_mode'} eq "without_result") {
     307            $result = "";           
     308            }
     309            else {
     310            # Read in the cached result lines and join them into a single string
     311            my $result_filename = "$ofilename.result";
     312            if (open(RESIN, "<$result_filename"))
     313            {
     314                my @result_lines = <RESIN>;
     315                $result = join("\n", @result_lines);
     316                close(RESIN);
     317            }
     318            else
     319            {
     320                print $outhandle "  $message_prefix: Error, failed to obtain cached result from $result_filename.\n";
     321            }
     322            }
    317323        }
    318324           
Note: See TracChangeset for help on using the changeset viewer.