- Timestamp:
- Mar 8, 2023, 9:44:22 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/eam/rawfix.20230221/src/get_md5s_instances.pl
r42399 r42400 21 21 22 22 # read the list of instances: 23 my @ins_list= &load_instance_list ($input);23 my ($ins_list_r, $dst_list_r, $md5_list_r) = &load_instance_list ($input); 24 24 25 25 my $output = $input; … … 29 29 open (OUTFILE, ">$output"); 30 30 31 foreach my $instance (@ins_list) { 31 # foreach my $instance (@$ins_list_r) { 32 for (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]; 32 37 33 38 my $filename = $instance; 34 39 $filename =~ s|file://||; 35 # print "filename: $filename\n";36 40 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 } 38 47 39 48 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"; 43 50 } 44 51 close OUTFILE; 45 46 die "all done"; 52 exit 0; 47 53 48 54 # read the list of chip_ids: … … 50 56 my $infile = $_[0]; 51 57 52 my @ins_list;58 my (@ins_list, @dst_list, @md5_list); 53 59 54 60 open(FILE,$infile) or die "cannot open file $infile\n"; … … 61 67 my @words = split (/\s+/,$line); 62 68 63 if (@words != 1) { die "error in input $infile : $line\n"; }69 if (@words != 3) { die "error in input $infile : $line\n"; } 64 70 push (@ins_list, $words[0]); 71 push (@dst_list, $words[1]); 72 push (@md5_list, $words[2]); 65 73 } 66 74 close (FILE); 67 75 68 return @ins_list;76 return (\@ins_list, \@dst_list, \@md5_list); 69 77 } 70 78
Note:
See TracChangeset
for help on using the changeset viewer.
