Hello community, here is the log from the commit of package yast2-registration for openSUSE:Factory checked in at 2019-10-27 13:36:15 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-registration (Old) and /work/SRC/openSUSE:Factory/.yast2-registration.new.2990 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-registration" Sun Oct 27 13:36:15 2019 rev:42 rq:742951 version:4.2.14 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-registration/yast2-registration.changes 2019-10-16 09:10:07.648265156 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-registration.new.2990/yast2-registration.changes 2019-10-27 13:36:16.768910923 +0100 @@ -1,0 +2,14 @@ +Fri Oct 25 12:56:35 UTC 2019 - Josef Reidinger <jreidin...@suse.com> + +- Upgrade support for the Online installation medium + (jsc#SLE-7214) +- 4.2.14 + +------------------------------------------------------------------- +Fri Oct 18 10:14:56 UTC 2019 - Ladislav Slezák <lsle...@suse.cz> + +- AutoYaST support for the OnlineOnly installation medium + (jsc#SLE-7214) +- 4.2.13 + +------------------------------------------------------------------- Old: ---- yast2-registration-4.2.12.tar.bz2 New: ---- yast2-registration-4.2.14.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-registration.spec ++++++ --- /var/tmp/diff_new_pack.WDbtcp/_old 2019-10-27 13:36:17.280911575 +0100 +++ /var/tmp/diff_new_pack.WDbtcp/_new 2019-10-27 13:36:17.288911585 +0100 @@ -17,7 +17,7 @@ Name: yast2-registration -Version: 4.2.12 +Version: 4.2.14 Release: 0 Summary: YaST2 - Registration Module License: GPL-2.0-only ++++++ yast2-registration-4.2.12.tar.bz2 -> yast2-registration-4.2.14.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-4.2.12/package/yast2-registration.changes new/yast2-registration-4.2.14/package/yast2-registration.changes --- old/yast2-registration-4.2.12/package/yast2-registration.changes 2019-10-11 16:59:42.000000000 +0200 +++ new/yast2-registration-4.2.14/package/yast2-registration.changes 2019-10-25 16:27:29.000000000 +0200 @@ -1,4 +1,18 @@ ------------------------------------------------------------------- +Fri Oct 25 12:56:35 UTC 2019 - Josef Reidinger <jreidin...@suse.com> + +- Upgrade support for the Online installation medium + (jsc#SLE-7214) +- 4.2.14 + +------------------------------------------------------------------- +Fri Oct 18 10:14:56 UTC 2019 - Ladislav Slezák <lsle...@suse.cz> + +- AutoYaST support for the OnlineOnly installation medium + (jsc#SLE-7214) +- 4.2.13 + +------------------------------------------------------------------- Thu Oct 10 13:39:18 UTC 2019 - Josef Reidinger <jreidin...@suse.com> - fix crash of autoyast config dialog (bsc#1152913) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-4.2.12/package/yast2-registration.spec new/yast2-registration-4.2.14/package/yast2-registration.spec --- old/yast2-registration-4.2.12/package/yast2-registration.spec 2019-10-11 16:59:42.000000000 +0200 +++ new/yast2-registration-4.2.14/package/yast2-registration.spec 2019-10-25 16:27:29.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-registration -Version: 4.2.12 +Version: 4.2.14 Release: 0 Summary: YaST2 - Registration Module License: GPL-2.0-only diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-4.2.12/src/clients/scc_auto.rb new/yast2-registration-4.2.14/src/clients/scc_auto.rb --- old/yast2-registration-4.2.12/src/clients/scc_auto.rb 2019-10-11 16:59:42.000000000 +0200 +++ new/yast2-registration-4.2.14/src/clients/scc_auto.rb 2019-10-25 16:27:29.000000000 +0200 @@ -41,6 +41,8 @@ require "registration/ui/autoyast_config_workflow" require "registration/ui/offline_migration_workflow" require "registration/erb_renderer.rb" +require "y2packager/product_control_product" +require "y2packager/medium_type" module Yast class SccAutoClient < Client @@ -76,6 +78,9 @@ Yast.import "Label" Yast.import "Report" Yast.import "Popup" + Yast.import "Profile" + Yast.import "Packages" + Yast.import "Report" Yast.import "Installation" end @@ -200,6 +205,12 @@ return ret == :next end + # special handling for the online installation medium, + # we need to evaluate the base products defined in the control.xml + if Y2Packager::MediumType.online? + return false unless online_medium_config + end + ret = ::Registration::ConnectHelpers.catch_registration_errors do import_certificate(@config.reg_server_cert) register_base_product && register_addons @@ -211,6 +222,35 @@ true end + + # Select the product from the control.xml (for the online installation medium) + # @return [Boolean] true on success, false on failure + def online_medium_config + # import the GPG keys before refreshing the repositories + Yast::Packages.ImportGPGKeys + + products = Y2Packager::ProductControlProduct.products + ay_product = Profile.current.fetch("software", {}).fetch("products", []).first + + if !ay_product + # TRANSLATORS: error message, %s is the XML path, e.g. "software/products" + Report.Error(_("Missing product specification in the %s section") % "software/products") + return false + end + + control_product = products.find { |p| p.name == ay_product } + + if !control_product + # TRANSLATORS: error message, %s is a product ID, e.g. "SLES" + Report.Error(_("Product %s not found") % ay_product) + return false + end + + # mark the control file product as selected + Y2Packager::ProductControlProduct.selected = control_product + + true + end # delete all previous services and repositories def repo_cleanup diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-4.2.12/src/lib/registration/registration.rb new/yast2-registration-4.2.14/src/lib/registration/registration.rb --- old/yast2-registration-4.2.12/src/lib/registration/registration.rb 2019-10-11 16:59:42.000000000 +0200 +++ new/yast2-registration-4.2.14/src/lib/registration/registration.rb 2019-10-25 16:27:29.000000000 +0200 @@ -136,7 +136,11 @@ # @return [Array<Addon>] List of addons, empty if no base product is found def get_addon_list # extensions for base product - base_product = ::Registration::SwMgmt.base_product_to_register + base_product = if Yast::Mode.update + ::Registration::SwMgmt.installed_base_product + else + ::Registration::SwMgmt.base_product_to_register + end if !base_product log.warn "No base product, skipping addons" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-4.2.12/src/lib/registration/sw_mgmt.rb new/yast2-registration-4.2.14/src/lib/registration/sw_mgmt.rb --- old/yast2-registration-4.2.12/src/lib/registration/sw_mgmt.rb 2019-10-11 16:59:42.000000000 +0200 +++ new/yast2-registration-4.2.14/src/lib/registration/sw_mgmt.rb 2019-10-25 16:27:29.000000000 +0200 @@ -152,8 +152,16 @@ # Product to register for the online installation medium # @return [Hash] The product Hash def self.online_base_product - prod = Y2Packager::ProductControlProduct.selected - raise "No base product selected from control.xml!" unless prod + if Mode.update + prods = Y2Packager::ProductControlProduct.products + installed_names = installed_products.map { |p| p["name"] } + prod = prods.find { |p| installed_names.include?(p.name) } + log.info "selecting product from control #{prod}" + raise "No base product selected from control.xml matching installed products!" unless prod + else + prod = Y2Packager::ProductControlProduct.selected + raise "No base product selected from control.xml!" unless prod + end { "name" => prod.name, @@ -201,6 +209,11 @@ products.first end + def self.installed_base_product + reader = Y2Packager::ProductReader.new + reader.installed_base_product.resolvable_properties + end + # Evaluate the product if it is a base product depending on the current # system status. # @param p [Hash] the product from pkg-bindings @@ -696,21 +709,33 @@ # @param destdir [String] the target directory # @return [String] target distribution name or empty string if not found def self.target_distribution(destdir) - # ensure the target is initialized - Pkg.TargetInitialize(destdir) - # the sources are initialized by the Product.FindBaseProducts call internally - base_products = Product.FindBaseProducts - - # empty target distribution disables service compatibility check in case - # the base product cannot be found - target_distro = base_products ? base_products.first["register_target"] : "" - log.info "Base product target distribution: #{target_distro.inspect}" + if Y2Packager::MediumType.online? + control_products = Y2Packager::ProductControlProduct.products - # Save the current repositories so they are not lost - Pkg.SourceSaveAll - # close both target and sources to fully reinitialize later - Pkg.SourceFinishAll - Pkg.TargetFinish + target_distro = if control_products.empty? + "" + else + # curently all products have the same "register_target" value + control_products.first.register_target || "" + end + else + # ensure the target is initialized + Pkg.TargetInitialize(destdir) + # the sources are initialized by the Product.FindBaseProducts call internally + base_products = Product.FindBaseProducts + + # empty target distribution disables service compatibility check in case + # the base product cannot be found + target_distro = base_products ? base_products.first["register_target"] : "" + + # Save the current repositories so they are not lost + Pkg.SourceSaveAll + # close both target and sources to fully reinitialize later + Pkg.SourceFinishAll + Pkg.TargetFinish + end + + log.info "Base product target distribution: #{target_distro.inspect}" target_distro end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-4.2.12/src/lib/registration/ui/migration_repos_workflow.rb new/yast2-registration-4.2.14/src/lib/registration/ui/migration_repos_workflow.rb --- old/yast2-registration-4.2.12/src/lib/registration/ui/migration_repos_workflow.rb 2019-10-11 16:59:42.000000000 +0200 +++ new/yast2-registration-4.2.14/src/lib/registration/ui/migration_repos_workflow.rb 2019-10-25 16:27:29.000000000 +0200 @@ -211,13 +211,13 @@ end def not_installed_products_check - SwMgmt.init(true) - # FIXME: do the check also at offline upgrade? # Currently it reads the addons for the new SLES15 which is not # registered yet and fails. return :next if Yast::Stage.initial + SwMgmt.init(true) + Addon.find_all(registration) UI::NotInstalledProductsDialog.run diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-4.2.12/test/spec_helper.rb new/yast2-registration-4.2.14/test/spec_helper.rb --- old/yast2-registration-4.2.12/test/spec_helper.rb 2019-10-11 16:59:42.000000000 +0200 +++ new/yast2-registration-4.2.14/test/spec_helper.rb 2019-10-25 16:27:29.000000000 +0200 @@ -81,6 +81,15 @@ stub_product_selection +# stub module to prevent its Import +# Useful for modules from different yast packages, to avoid build dependencies +def stub_module(name) + Yast.const_set name.to_sym, Class.new { def self.fake_method; end } +end + +# stub classes from other modules to avoid build dependencies +stub_module("Profile") + # load data generators require_relative "factories"