diff --git a/src/api/app/controllers/source_project_controller.rb b/src/api/app/controllers/source_project_controller.rb index 5eed128a291..c1c01f11144 100644 --- a/src/api/app/controllers/source_project_controller.rb +++ b/src/api/app/controllers/source_project_controller.rb @@ -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: Mirar expand_all_packages + @packages = params.key?(:expand) ? @project.expand_all_packages : @project.packages render locals: { expand: params.key?(:expand) }, formats: [:xml] end diff --git a/src/api/app/views/source_project/show.xml.builder b/src/api/app/views/source_project/show.xml.builder index 36ecd40efd1..754add6baa7 100644 --- a/src/api/app/views/source_project/show.xml.builder +++ b/src/api/app/views/source_project/show.xml.builder @@ -1,9 +1,16 @@ xml.directory(count: @packages.count) do - @packages.map do |name, project| + @packages.sort_by(&:name).map do |package, project| if expand - xml.entry(name: name, originproject: project) + xml.entry(name: package.name, originproject: project) else - xml.entry(name: name) + if 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: package.name) + end end end end