From c77c34578b138e4c62fd63084bd9e6ad98ef653f Mon Sep 17 00:00:00 2001 From: Max Lin Date: Tue, 7 Nov 2023 21:54:44 +0800 Subject: [PATCH] Update openSUSE Leap distribution id prior to 15.6 Add openSUSE Leap 15.4 and 15.5 distribution id, and removed EOL'ed Leap 15.3. This change also limits the canonical projects to Leap only as it was the only official distribution doesn't have a dedicated baseproject for providing the package. --- app/controllers/application_controller.rb | 15 +++++++++------ app/controllers/search_controller.rb | 2 +- config/initializers/distributions_projects.rb | 19 +++++++++++++++---- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index b1c45a0d4..fe77892ed 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -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 diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index a82355f8e..a256f81c8 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -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 diff --git a/config/initializers/distributions_projects.rb b/config/initializers/distributions_projects.rb index 8e172cdd4..149a8b9ae 100644 --- a/config/initializers/distributions_projects.rb +++ b/config/initializers/distributions_projects.rb @@ -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