Skip to content

Commit

Permalink
Checker: small cleanups
Browse files Browse the repository at this point in the history
- there is no cyclevel 4 anymore
- unify the cycle packages just in case
- make sure incycle is not undef
  • Loading branch information
mlschroe committed Sep 12, 2023
1 parent 38aec36 commit 03ec781
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions PBuild/Checker.pm
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ sub pkgexpand {
sub cycsort {
my ($pkg2dep, $dep2src, $pkg2src, @cyc) = @_;

@cyc = sort(@cyc);
@cyc = PBuild::Util::unify(sort(@cyc));
my %d;
my %cdeps;
for my $pkg (@cyc) {
Expand Down Expand Up @@ -199,7 +199,6 @@ sub pkgcheck {
my $incycle = 0;
if ($cychash->{$packid}) {
($packid, $incycle) = handlecycle($ctx, $packid, \@cpacks, \%cycpass);
next if $incycle == 4; # ignore after pass1/2
next if $packstatus{$packid} && $packstatus{$packid} ne 'done' && $packstatus{$packid} ne 'succeeded' && $packstatus{$packid} ne 'failed'; # already decided
}
my $p = $pkgsrc->{$packid};
Expand Down Expand Up @@ -559,7 +558,7 @@ sub handlecycle {
my ($ctx, $packid, $cpacks, $cycpass) = @_;
my $cychash = $ctx->{'cychash'};
return ($packid, 0) unless $cychash->{$packid};
my $incycle = $cycpass->{$packid};
my $incycle = $cycpass->{$packid} || 0;
return ($packid, $incycle) if $incycle > 0; # still in pass
my @cycp = @{$cychash->{$packid}};
$incycle = -$incycle + 1; # start next pass
Expand Down

0 comments on commit 03ec781

Please sign in to comment.