Skip to content

Commit

Permalink
pbuild: move cycle blocked setting into handlecycle
Browse files Browse the repository at this point in the history
The old location does not work, it just sets every package
from a build cycle to the blocked state.
  • Loading branch information
mlschroe committed Sep 21, 2023
1 parent 935c03d commit b97e470
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions PBuild/Checker.pm
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ sub pkgcheck {
my $incycle = 0;
if ($cychash->{$packid}) {
($packid, $incycle) = handlecycle($ctx, $packid, \@cpacks, \%cycpass);
next if $packstatus{$packid} && $packstatus{$packid} ne 'done' && $packstatus{$packid} ne 'succeeded' && $packstatus{$packid} ne 'failed'; # already decided
next if !$packid || ($packstatus{$packid} && $packstatus{$packid} ne 'done' && $packstatus{$packid} ne 'succeeded' && $packstatus{$packid} ne 'failed'); # already decided
}
my $p = $pkgsrc->{$packid};
if ($p->{'error'}) {
Expand Down Expand Up @@ -404,12 +404,6 @@ sub check {
# calculate if we're blocked
my @blocked = grep {$notready->{$dep2src->{$_}}} @$edeps;
@blocked = () if $ctx->{'block'} && $ctx->{'block'} eq 'never';
# check if cycle builds are in progress
if ($incycle && $incycle == 3) {
push @blocked, 'cycle' unless @blocked;
splice(@blocked, 10, scalar(@blocked), '...') if @blocked > 10;
return ('blocked', join(', ', @blocked));
}
# prune cycle packages from blocked
if ($incycle > 1) {
my $cyclevel = $ctx->{'cyclevel'};
Expand Down Expand Up @@ -574,8 +568,12 @@ sub handlecycle {
$packid = shift @$cpacks;
$cycpass->{$packid} = -2; # set pass2 endmarker
} elsif ($incycle == 3) {
unshift @$cpacks, @cycp;
$packid = shift @$cpacks;
my $notready = $ctx->{'notready'};
my $pkgsrc = $ctx->{'pkgsrc'};
if (grep {$notready->{$_->{'name'} || $_->{'pkg'}}} map {$pkgsrc->{$_}} @cycp) {
$notready->{$_->{'name'} || $_->{'pkg'}} ||= 1 for @cycp;
}
return (undef, 3);
}
return ($packid, $incycle);
}
Expand Down

0 comments on commit b97e470

Please sign in to comment.