Skip to content

Commit

Permalink
[backend] add compatibility hack so that a package always has a proje…
Browse files Browse the repository at this point in the history
…ct element

Some really old obs versions didn't add a project element when creating
a package.
  • Loading branch information
mlschroe authored and adrianschroeter committed Nov 24, 2014
1 parent dfaa9bd commit 7f26c54
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/backend/bs_srcserver
Expand Up @@ -3743,6 +3743,7 @@ sub getpackage {
return ($meta);
}
my $pack = readpack($projid, $packid, 1);
$pack->{'project'} ||= $projid if $pack;
if (!$pack && $proj->{'link'}) {
my %checked = ($projid => 1);
my @todo = map {$_->{'project'}} @{$proj->{'link'}};
Expand All @@ -3765,6 +3766,7 @@ sub getpackage {
}
} else {
$pack = readpack($lprojid, $packid, 1);
$pack->{'project'} ||= $lprojid if $pack;
unshift @todo, map {$_->{'project'}} @{$lproj->{'link'}} if !$pack && $lproj->{'link'};
}
last if $pack;
Expand Down

0 comments on commit 7f26c54

Please sign in to comment.