Skip to content

Commit

Permalink
Clean up failure detection code
Browse files Browse the repository at this point in the history
  • Loading branch information
mlschroe committed Feb 25, 2021
1 parent 2062e14 commit 5f02a4c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions PBuild/Result.pm
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,20 @@ use strict;
use PBuild::Util;

my @code_order = qw{broken succeeded failed unresolvable blocked scheduled waiting building excluded disabled locked};
my @code_failures = qw{broken failed unresolvable};
my %code_failures = map {$_ => 1} qw{broken failed unresolvable};

sub print_result {
my ($opts, $builddir) = @_;
my $r = PBuild::Util::retrieve("$builddir/.pbuild/_result");
die("pbuild has not run yet for $builddir\n") unless $r;
my %codefilter = map {$_ => 1} @{$opts->{'result-code'} || []};
my %pkgfilter = map {$_ => 1} @{$opts->{'result-pkg'} || []};
my %buildfailfilter = map{$_ => 1} @code_failures;
my $found_failures = 0;
my %codes_seen;
for my $pkg (sort keys %$r) {
next if %pkgfilter && !$pkgfilter{$pkg};
my $code = $r->{$pkg}->{'code'} || 'unknown';
$found_failures = 1 if ($buildfailfilter{$code});
$found_failures = 1 if $code_failures{$code};
next if %codefilter && !$codefilter{'all'} && !$codefilter{$code};
push @{$codes_seen{$code}}, $pkg;
}
Expand Down

0 comments on commit 5f02a4c

Please sign in to comment.