57 my $err = $csv->error_input(); |
57 my $err = $csv->error_input(); |
58 warn "Failed to parse $raptorSummary line line $. as CSV '$line': $err Skipping\n"; |
58 warn "Failed to parse $raptorSummary line line $. as CSV '$line': $err Skipping\n"; |
59 next; |
59 next; |
60 } |
60 } |
61 |
61 |
62 my @keys = qw{category subcategory severity config component phase recipe file linenum}; |
62 my @keys = qw{category subcategory severity config component mmp phase recipe file linenum}; |
63 my @values = $csv->fields(); |
63 my @values = $csv->fields(); |
64 unless (scalar @values == scalar @keys) |
64 unless (scalar @values == scalar @keys) |
65 { |
65 { |
66 warn "WARNING: line does not match expected format at $raptorSummary line $.. Skipping\n"; |
66 warn "WARNING: (raptorToBRAG.pl) line does not match expected format at $raptorSummary line $.. Skipping\n"; |
67 next; |
67 next; |
68 } |
68 } |
69 |
69 |
70 # Populate the hash using a hash slice |
70 # Populate the hash using a hash slice |
71 my $failure = {}; |
71 my $failure = {}; |
72 @{$failure}{@keys} = @values; |
72 @{$failure}{@keys} = @values; |
73 |
73 |
74 if (!$failure->{category}) |
74 if (!$failure->{category}) |
75 { |
75 { |
76 warn "WARNING: summary line without a category at $raptorSummary line $.. Skipping\n"; |
76 warn "WARNING: (raptorToBRAG.pl) summary line without a category at $raptorSummary line $.. Skipping\n"; |
77 next; |
77 next; |
78 } |
78 } |
79 |
79 |
80 if ($failure->{category} =~ m{^recipe_failure$}i and !$failure->{component}) |
80 if ($failure->{category} =~ m{^recipe_failure$}i and !$failure->{component}) |
81 { |
81 { |
82 warn "WARNING: recipe_failure with component field empty at $raptorSummary line $.. Skipping\n"; |
82 warn "WARNING: (raptorToBRAG.pl) recipe_failure with component field empty at $raptorSummary line $.. Skipping\n"; |
83 next; |
83 next; |
84 } |
84 } |
85 $failure->{subcategory} ||= 'uncategorized'; |
85 $failure->{subcategory} ||= 'uncategorized'; |
86 $failure->{severity} ||= 'unknown'; |
86 $failure->{severity} ||= 'unknown'; |
87 |
87 |