Ignore:
Timestamp:
2013-06-24T22:43:44+12:00 (11 years ago)
Author:
ak19
Message:

Fixed another very subtle to do with the case of the TASK_HOME env var set in environment.pl used by envi when launched via run-gs2-diffcol.pl. It ends up being all lowercase by the time import.pl is run and archiveinf-doc is generated. This then ends up being sorted differently when db2txt -sort is run on it than if the title case of TASK_HOME had been preserved, as happens when task.pl is run directly (and TASK_HOME is taken as the current working dir at that point)

Location:
other-projects/nightly-tasks/diffcol/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • other-projects/nightly-tasks/diffcol/trunk/diffcol/gdbdiff.pm

    r27696 r27701  
    1111use diffutil;
    1212use Text::Diff;
     13use Cwd;
    1314
    1415if ($^O =~ m/mswin/i) {
     
    5859    my $test_text = readin_gdb($test_cmd);
    5960
    60 #   my $savepath = "C:\\Research\\Nightly\\tools\\envi\\etc\\tasks\\diffcol\\"
     61#   my $savepath = &getcwd."/../"; # TASK_HOME env does not exist at this stage, but it's one level up from current directory
    6162#   print_string_to_file($test_text, $savepath.$dbname."_test.out");   
    6263#   print_string_to_file($model_text, $savepath.$dbname."_model.out");
    6364
    6465    # filter out the fields that can be ignored in the two database files
    65     my $ignore_line_re = "\n<(lastmodified|lastmodifieddate|oailastmodified|oailastmodifieddate)>([^\n])*";
     66    # The total_numbytes field can vary depending on how many backslashes exist in the urls in the main body text, as each
     67    # of these windows slashes get escaped with another backslash, and the resulting string is used as key into rel link db
     68    my $ignore_line_re = "\n<(lastmodified|lastmodifieddate|oailastmodified|oailastmodifieddate|total_numbytes)>([^\n])*";
    6669    $model_text =~ s/$ignore_line_re//g;
    6770    $test_text =~ s/$ignore_line_re//g;
    68  
     71
    6972
    7073    # if the OS doesn't match and one of them is windows, extra work needs to be done to bring the db files
     
    129132       
    130133        # for the windows text, need to further get rid of the driveletter after [ or <meta>
    131         $$win_text =~ s@^(\[|<[^>]*>)[a-zA-Z]:collect@$1collect@mg;
    132         # now can go back to using $model_text and $test_text
    133 #   print_string_to_file($$win_text, $savepath.$dbname."_test.out");   
    134 #   print_string_to_file($$lin_text, $$savepath.$dbname."_model.out");
     134        $$win_text =~ s@^(\[|<[^>]*>)[a-zA-Z]:collect@$1collect@mg;     
    135135       
    136136    } # end of equalising differences between a windows collection's db file and linux coll's db file
    137137
    138    
    139138    # now can go back to using $model_text and $test_text
    140     #print_string_to_file($test_text, "C:\\Research\\Nightly\\tools\\envi\\etc\\tasks\\diffcol\\".$dbname."_test.out");
    141     #print_string_to_file($model_text, "C:\\Research\\Nightly\\tools\\envi\\etc\\tasks\\diffcol\\".$dbname."_model.out");
    142        
     139#   print_string_to_file($test_text, $savepath.$dbname."_test.out");   
     140#   print_string_to_file($model_text, $savepath.$dbname."_model.out");
    143141   
    144142    my $report_type = "OldStyle"; # Can not change this type.
  • other-projects/nightly-tasks/diffcol/trunk/task.pl

    r27694 r27701  
    3737my $use_blat = 0; # if we ever get blat to send mail/attachments on Windows working, set this to 1
    3838
     39
    3940# TASK_HOME should be the toplevel diffcol folder
    4041$ENV{'TASK_HOME'} = getcwd unless defined $ENV{'TASK_HOME'};
    41 $ENV{'TASK_HOME'} =~ s@\/@\\@g if $isWin;
     42if($isWin) {
     43    $ENV{'TASK_HOME'} =~ s@\/@\\@g;
     44    # need to convert TASK_HOME path name to resolve very subtle bug when running task.pl via
     45    # run-gs2-diffcol.bat which uses environment.pl's TASK_HOME setting via envi
     46    # At that point TASK_HOME is already defined but ends up lowercase, so that entries in archiveinf-doc
     47    # end up sorted differently when db2txt -sort is applied compared to if TASK_HOME had kept its case.   
     48    require Win32; # for working out Windows Long Filenames from Win 8.3 short filenames
     49    $ENV{'TASK_HOME'} = &Win32::GetLongPathName($ENV{'TASK_HOME'});
     50}
    4251##    print STDERR "@@@ TASK_HOME: ".$ENV{'TASK_HOME'}."\n";
    4352
     
    392401    print STDERR "$collection - Importing:\n";
    393402    print $xml_fh "<import>\n";
    394     &run_build_script("import.pl $collection -removeold"); #-OIDtype hash_on_full_filename
     403    &run_build_script("import.pl -removeold $collection"); #-OIDtype hash_on_full_filename
    395404    print $xml_fh "</import>\n";
    396405    print STDERR "done\n"; 
     
    399408    print STDERR "$collection - Building:\n";
    400409    print $xml_fh "<build>\n";
    401     &run_build_script("buildcol.pl $collection -removeold");
     410    &run_build_script("buildcol.pl -removeold $collection");
    402411    print $xml_fh "</build>\n";
    403412    print STDERR "done\n";
Note: See TracChangeset for help on using the changeset viewer.