Skip to content

Commit

Permalink
[backend] make loop detection work in _history link expansion
Browse files Browse the repository at this point in the history
  • Loading branch information
mlschroe committed Oct 24, 2013
1 parent 90bd41f commit d3ebed9
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/backend/bs_srcserver
Original file line number Diff line number Diff line change
Expand Up @@ -3700,12 +3700,11 @@ sub getpackagehistory {
if ($packid ne '_project' && ! -e "$projectsdir/$projid.pkg/$packid.xml") {
# check project links
die("404 package '$packid' does not exist\n") unless $proj->{'link'};
my %checked = ($projid => 1);
my @todo = map {$_->{'project'}} @{$proj->{'link'}};
while (@todo) {
my $lprojid = shift @todo;
next if $checked{$lprojid};
$checked{$lprojid} = 1;
$cgi->{'_checked'} ||= {};
$cgi->{'_checked'}->{$projid} = 1;
for my $lprojid (map {$_->{'project'}} @{$proj->{'link'}}) {
next if $cgi->{'_checked'}->{$lprojid};
$cgi->{'_checked'}->{$lprojid} = 1;
my $h;
eval {
$h = (getpackagehistory($cgi, $lprojid, $packid))[0];
Expand Down

0 comments on commit d3ebed9

Please sign in to comment.