Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update openSUSE Leap distribution id prior to 15.6 #1414

Merged
merged 1 commit into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,16 @@ def fix_package_projects
if repo
package.realproject = package.project
package.baseproject = repo[:project]
# one off exception for Leap 15.3, which switched it's default
# repository name from openSUSE_Leap_15.3 to 15.3
elsif package.repository == 'openSUSE_Leap_15.3'
leap153 = @distributions.find { |d| d[:dist_id] == '20043' }
next unless leap153
elsif package.repository == 'openSUSE_Leap_15.4'
leap154 = @distributions.find { |d| d[:dist_id] == '23178' }
next unless leap154

package.baseproject = leap153[:project]
package.baseproject = leap154[:project]
elsif package.repository == 'openSUSE_Leap_15.5'
leap155 = @distributions.find { |d| d[:dist_id] == '23175' }
next unless leap155

package.baseproject = leap155[:project]
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/search_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,6 @@ def index
private

def baseproject_not_canonical?
['SUSE:SLE-15-SP3:GA', 'SUSE:SLE-15-SP2:GA', 'SUSE:SLE-15-SP1:GA', 'openSUSE:Leap:15.3'].include?(@baseproject)
['openSUSE:Leap:15.5', 'openSUSE:Leap:15.4'].include?(@baseproject)
end
end
19 changes: 15 additions & 4 deletions config/initializers/distributions_projects.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,19 @@

# maps a distro_id to an Array of project names that could be the baseproject
DISTRIBUTION_PROJECTS_OVERRIDE = {
# Leap 15.3
'20452' => ['SUSE:SLE-15:GA', 'SUSE:SLE-15:Update', 'SUSE:SLE-15-SP1:GA',
'SUSE:SLE-15-SP1:Update', 'SUSE:SLE-15-SP2:GA', 'SUSE:SLE-15-SP2:Update',
'SUSE:SLE-15-SP3:GA', 'SUSE:SLE-15-SP3:Update', 'openSUSE:Leap:15.3', 'openSUSE:Backports:SLE-15-SP3']
# Leap 15.4
'23178' => ['SUSE:SLE-15:GA', 'SUSE:SLE-15:Update',
'SUSE:SLE-15-SP1:GA', 'SUSE:SLE-15-SP1:Update',
'SUSE:SLE-15-SP2:GA', 'SUSE:SLE-15-SP2:Update',
'SUSE:SLE-15-SP3:GA', 'SUSE:SLE-15-SP3:Update',
'SUSE:SLE-15-SP4:GA', 'SUSE:SLE-15-SP4:Update',
'openSUSE:Backports:SLE-15-SP4', 'openSUSE:Leap:15.4'],
# Leap 15.5
'23175' => ['SUSE:SLE-15:GA','SUSE:SLE-15:Update',
'SUSE:SLE-15-SP1:GA','SUSE:SLE-15-SP1:Update',
'SUSE:SLE-15-SP2:GA', 'SUSE:SLE-15-SP2:Update',
'SUSE:SLE-15-SP3:GA', 'SUSE:SLE-15-SP3:Update',
'SUSE:SLE-15-SP4:GA', 'SUSE:SLE-15-SP4:Update',
'SUSE:SLE-15-SP5:GA', 'SUSE:SLE-15-SP5:Update',
'openSUSE:Backports:SLE-15-SP5', 'openSUSE:Leap:15.5']
}.freeze