Skip to content

Commit

Permalink
Display multibuild flavors when asking for local project sources
Browse files Browse the repository at this point in the history
There was a consistency gap between sources coming from local projects
and sources coming from remote projects. Multibuild flavors were only
shown for remote projects. Now the multibuild flavors are shown in both
cases.

Fixes openSUSE#16911
  • Loading branch information
danidoni committed Oct 3, 2024
1 parent 0b51ef0 commit 80edffb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/api/app/controllers/source_project_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ def render_project_issues
end

def render_project_packages
@packages = params.key?(:expand) ? @project.expand_all_packages : @project.packages.pluck(:name)
# TODO: Display multibuild flavors when passing the expand param
@packages = params.key?(:expand) ? @project.expand_all_packages : @project.packages.sort_by(&:name)
render locals: { expand: params.key?(:expand) }, formats: [:xml]
end

Expand Down
11 changes: 8 additions & 3 deletions src/api/app/views/source_project/show.xml.builder
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
xml.directory(count: @packages.count) do
@packages.map do |name, project|
@packages.map do |package, project|
if expand
xml.entry(name: name, originproject: project)
xml.entry(name: package, originproject: project)
elsif package.multibuild?
xml.entry(name: package.name)
package.multibuild_flavors.each do |flavor|
xml.entry(name: "#{package.name}:#{flavor}", originpackage: package.name)
end
else
xml.entry(name: name)
xml.entry(name: package)
end
end
end

0 comments on commit 80edffb

Please sign in to comment.