Skip to content

Commit

Permalink
Update openSUSE Leap distribution id prior to 15.6
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nilxam committed Nov 7, 2023
1 parent 52cd38f commit c77c345
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 11 deletions.
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

0 comments on commit c77c345

Please sign in to comment.