Skip to content

Commit

Permalink
[api] support splitted products on top of released updates
Browse files Browse the repository at this point in the history
Channels were not setup correctly when all of the following was true:
* Existing updates for packages
* channels were using local linked packages
* but not using the main package

Moved the long and complex test case into an own file
  • Loading branch information
adrianschroeter committed Jan 22, 2015
1 parent b28b6d5 commit cbf1e12
Show file tree
Hide file tree
Showing 3 changed files with 725 additions and 624 deletions.
10 changes: 8 additions & 2 deletions src/api/app/models/package.rb
Expand Up @@ -737,7 +737,7 @@ def origin_container
# from external project, so it is my origin
prj = Project.get_by_name(li['project'])
pkg = prj.find_package(li['package'])
return pkg if li['project'] != prj.name
return pkg if self.project != prj

# broken or remote link, aborting
return nil if pkg.nil?
Expand Down Expand Up @@ -780,8 +780,14 @@ def add_channels
cb.create_channel_package_into(self.project)
end
# and all possible existing local links
if opkg.project.is_maintenance_release? and opkg.is_link?
opkg = opkg.project.packages.find_by_name opkg.linkinfo["package"]
end
opkg.find_project_local_linking_packages.each do |p|
ChannelBinary.find_by_project_and_package(project_name, p.name).each do |cb|
name = p.name
# strip incident suffix in update release projects
name.gsub!(/\.[^\.]*/,'') if opkg.project.is_maintenance_release? and opkg.is_link?
ChannelBinary.find_by_project_and_package(project_name, name).each do |cb|
cb.create_channel_package_into(self.project)
end
end
Expand Down

0 comments on commit cbf1e12

Please sign in to comment.