Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/SLE-15-SP6' into sync_master
Browse files Browse the repository at this point in the history
  • Loading branch information
lslezak committed Mar 14, 2024
2 parents c684595 + adcb68f commit 26c742b
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .rubocop.yml
Expand Up @@ -18,7 +18,7 @@ Metrics/BlockNesting:

# TODO: this need some non-trivial refactoring...
Metrics/ClassLength:
Max: 480
Max: 490

# TODO: this need some non-trivial refactoring...
Metrics/CyclomaticComplexity:
Expand Down
6 changes: 6 additions & 0 deletions package/yast2-registration.changes
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Mar 14 12:57:02 UTC 2024 - Ladislav Slezák <lslezak@suse.com>

- Use the new product mapping API (related to bsc#1220567)
- 5.0.1

-------------------------------------------------------------------
Wed Aug 30 20:16:10 UTC 2023 - Josef Reidinger <jreidinger@suse.cz>

Expand Down
10 changes: 5 additions & 5 deletions package/yast2-registration.spec
Expand Up @@ -17,7 +17,7 @@


Name: yast2-registration
Version: 5.0.0
Version: 5.0.1
Release: 0
Summary: YaST2 - Registration Module
License: GPL-2.0-only
Expand All @@ -35,8 +35,8 @@ BuildRequires: rubygem(%{rb_default_ruby_abi}:rspec)
BuildRequires: rubygem(%{rb_default_ruby_abi}:yast-rake) >= 0.2.5
# uses Fiddle instead of FFI
BuildRequires: suseconnect-ruby-bindings > 0.0.4
# ProductSpec API
BuildRequires: yast2-packager >= 4.4.13
# new product mapping API
BuildRequires: yast2-packager >= 5.0.5
BuildRequires: yast2-update >= 3.1.36
# log.group call
BuildRequires: yast2-ruby-bindings >= 4.5.4
Expand All @@ -51,8 +51,8 @@ Requires: yast2-ruby-bindings >= 4.5.4
Requires: suseconnect-ruby-bindings > 0.0.4
Requires: yast2-add-on >= 3.1.8
Requires: yast2-slp >= 3.1.9
# ProductSpec API
Requires: yast2-packager >= 4.4.13
# new product mapping API
Requires: yast2-packager >= 5.0.5
Requires: yast2-update >= 3.1.36

# new calls in AutoinstGeneral
Expand Down
9 changes: 8 additions & 1 deletion src/lib/registration/ui/migration_repos_workflow.rb
Expand Up @@ -688,6 +688,13 @@ def full_medium_products
products = Y2Packager::ProductSpec.base_products
.select { |p| p.is_a?(Y2Packager::RepoProductSpec) }
log.info("Found base products on the offline medium: #{products.pretty_inspect}")

# in SP6+ always use the new product mapping
new_migration = true
log.info "Using SP6+ product upgrade mapping: #{new_migration}"
Y2Packager::ProductUpgrade.new_renames = new_migration
Yast::AddOnProduct.new_renames = new_migration

products
end

Expand All @@ -706,7 +713,7 @@ def full_medium_upgrade_product(installed_base)
# first check if there is a product rename defined for the installed products
# and the new renamed base product is available
# key in the mapping: list of installed products, value: the new base product
Y2Packager::ProductUpgrade::MAPPING.each do |k, v|
Y2Packager::ProductUpgrade.mapping.each do |k, v|
if (k - installed_names).empty?
new_base = base_products.find { |p| p.name == v }
end
Expand Down
12 changes: 12 additions & 0 deletions src/lib/registration/ui/migration_selection_dialog.rb
Expand Up @@ -18,6 +18,7 @@
require "registration/addon_sorter"
require "registration/sw_mgmt"
require "registration/url_helpers"
require "y2packager/product_upgrade"

module Registration
module UI
Expand Down Expand Up @@ -212,9 +213,19 @@ def update_details
selected = Yast::UI.QueryWidget(:migration_targets, :CurrentItem)
return unless selected

update_product_mapping
Yast::UI.ChangeWidget(Id(:details), :Value, migration_details(selected))
end

# helper method to update the product mapping in Y2Packager::ProductUpgrade
def update_product_mapping
# in SP6+ always use the new product mapping
new_migration = true
log.info "Using SP6+ product upgrade mapping: #{new_migration}"
Y2Packager::ProductUpgrade.new_renames = new_migration
Yast::AddOnProduct.new_renames = new_migration
end

# get migration details
# @param [Integer] idx migration index
# @return [String] user friendly description (in RichText format)
Expand Down Expand Up @@ -339,6 +350,7 @@ def product_change_summary(old_product, new_product)

# store the current UI values
def store_values
update_product_mapping
self.selected_migration = current_migration
self.manual_repo_selection = Yast::UI.QueryWidget(:manual_repos, :Value)
end
Expand Down

0 comments on commit 26c742b

Please sign in to comment.