From 34e976d5bab9bedda47762783d5da7d057b6b840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Fri, 8 Mar 2024 15:16:15 +0100 Subject: [PATCH] Fixed migration from SLE_HPC to SLES SP6+ (bsc#1220567) - 4.3.27 --- package/yast2-packager.changes | 8 ++++++++ package/yast2-packager.spec | 4 +++- src/modules/AddOnProduct.rb | 37 ++++++++++++++++++++++++++-------- 3 files changed, 40 insertions(+), 9 deletions(-) diff --git a/package/yast2-packager.changes b/package/yast2-packager.changes index d5f8a33d..4bc74376 100644 --- a/package/yast2-packager.changes +++ b/package/yast2-packager.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Mon Mar 11 15:36:54 UTC 2024 - Ladislav Slezák + +- Reimplemented the hardcoded product mapping to support also the + migration from SLE_HPC to SLES SP6+ (with the HPC module) + (bsc#1220567) +- 4.3.27 + ------------------------------------------------------------------- Tue Mar 15 12:50:30 UTC 2022 - Steffen Winterfeldt diff --git a/package/yast2-packager.spec b/package/yast2-packager.spec index 840ca127..c2e7921c 100644 --- a/package/yast2-packager.spec +++ b/package/yast2-packager.spec @@ -17,7 +17,7 @@ Name: yast2-packager -Version: 4.3.26 +Version: 4.3.27 Release: 0 Summary: YaST2 - Package Library License: GPL-2.0-or-later @@ -75,6 +75,8 @@ Requires: ruby-solv Conflicts: yast2-core < 2.15.10 # NotEnoughMemory-related functions moved to misc.ycp import-file Conflicts: yast2-add-on < 2.15.15 +# changed API in Yast::AddOnProduct +Conflicts: yast2-registration < 4.3.29 # ensure that 'checkmedia' is on the medium Recommends: checkmedia diff --git a/src/modules/AddOnProduct.rb b/src/modules/AddOnProduct.rb index 45e65a0b..43eaf68b 100644 --- a/src/modules/AddOnProduct.rb +++ b/src/modules/AddOnProduct.rb @@ -26,10 +26,6 @@ class AddOnProductClass < Module # SLE12 HA GEO is now included in SLE15 HA "sle-ha-geo" => ["sle-ha"], "SUSE_SLES_SAP" => ["SLES_SAP"], - # SLES-12 with HPC module can be replaced by SLE_HPC-15 - "SLES" => ["SLE_HPC"], - # this is an internal product so far... - "SLE-HPC" => ["SLE_HPC"], # SMT is now integrated into the base SLES "sle-smt" => ["SLES"], # Live patching is a module now (bsc#1074154) @@ -41,10 +37,35 @@ class AddOnProductClass < Module "sle-sdk" => ["sle-module-development-tools"], # openSUSE => SLES migration "openSUSE" => ["SLES"], + # openSUSE 15.3+ => SLES migration + "Leap" => ["SLES"], # the IBM tools have been renamed in SLE12->SLE15 upgrade "ibm-dlpar-utils" => ["ibm-power-tools"] }.freeze + private_constant :DEFAULT_PRODUCT_RENAMES + + attr_accessor :new_renames + + def default_product_renames + # special handling for the HPC product + product_mapping = if new_renames + { + # in SLE15-SP6+ SLE_HPC is replaced by SLES + HPC module + "SLE-HPC" => ["SLES"], + "SLE_HPC" => ["SLES"] + } + else + { + # in SLE15 SP5 (or older) the SLES + HPC module is upgraded to SLE_HPC + "SLES" => ["SLE_HPC"], + "SLE-HPC" => ["SLE_HPC"] + } + end + + product_mapping.merge!(DEFAULT_PRODUCT_RENAMES) + end + # @return [Hash] Product renames added externally through the #add_rename method attr_accessor :external_product_renames private :external_product_renames, :external_product_renames= @@ -1981,7 +2002,7 @@ def missing_upgrades # handle the product renames, if a renamed product was installed # replace it with the new product so the new product is preselected - DEFAULT_PRODUCT_RENAMES.each do |k, v| + default_product_renames.each do |k, v| next unless installed_addons.include?(k) installed_addons.delete(k) @@ -2072,12 +2093,12 @@ def renamed_by_libzypp?(old_name, new_name) # Determine whether a product rename is included in the fallback map # - # @see DEFAULT_PRODUCT_RENAMES + # @see default_product_renames # @see #renamed_at? def renamed_by_default?(old_name, new_name) log.info "Search #{old_name} -> #{new_name} rename in default map: " \ - "#{DEFAULT_PRODUCT_RENAMES.inspect}" - renamed_at?(DEFAULT_PRODUCT_RENAMES, old_name, new_name) + "#{default_product_renames.inspect}" + renamed_at?(default_product_renames, old_name, new_name) end # Determine whether a product rename is present on a given hash