IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Mar 8, 2023, 9:44:22 AM (3 years ago)
Author:
eugene
Message:

updates to rawfix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/eam/rawfix.20230221/src/get_md5s_instances.pl

    r42399 r42400  
    2121
    2222# read the list of instances:
    23 my @ins_list = &load_instance_list ($input);
     23my ($ins_list_r, $dst_list_r, $md5_list_r) = &load_instance_list ($input);
    2424
    2525my $output = $input;
     
    2929open (OUTFILE, ">$output");
    3030
    31 foreach my $instance (@ins_list) {
     31# foreach my $instance (@$ins_list_r) {
     32for (my $i = 0; $i < @$ins_list_r; $i ++) {
     33
     34    my $instance   = $ins_list_r->[$i];
     35    my $data_state = $dst_list_r->[$i];
     36    my $md5sum_tru = $md5_list_r->[$i];
    3237
    3338    my $filename = $instance;
    3439    $filename =~ s|file://||;
    35     # print "filename: $filename\n";
    3640
    37     my $line = `md5sum $filename`;
     41    my $line;
     42    if (0) {
     43        $line = "fakevalue $filename"; # XXX TEST: disable calculation:
     44    } else {
     45        $line = `md5sum $filename`;
     46    }
    3847
    3948    my ($md5sum, $rawfile) = split (" ", $line);
    40     # print "md5sum: $md5sum\n";
    41 
    42     print OUTFILE "$instance $md5sum\n";
     49    print OUTFILE "$instance $data_state $md5sum_tru $md5sum\n";
    4350}
    4451close OUTFILE;
    45 
    46 die "all done";
     52exit 0;
    4753
    4854# read the list of chip_ids:
     
    5056    my $infile = $_[0];
    5157
    52     my @ins_list;
     58    my (@ins_list, @dst_list, @md5_list);
    5359
    5460    open(FILE,$infile) or die "cannot open file $infile\n";
     
    6167        my @words = split (/\s+/,$line);
    6268
    63         if (@words != 1) { die "error in input $infile : $line\n"; }
     69        if (@words != 3) { die "error in input $infile : $line\n"; }
    6470        push (@ins_list, $words[0]);
     71        push (@dst_list, $words[1]);
     72        push (@md5_list, $words[2]);
    6573    }
    6674    close (FILE);
    6775
    68     return @ins_list;
     76    return (\@ins_list, \@dst_list, \@md5_list);
    6977}
    7078
Note: See TracChangeset for help on using the changeset viewer.