Hello community, here is the log from the commit of package yast2-registration for openSUSE:Factory checked in at 2019-01-24 14:00:45 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-registration (Old) and /work/SRC/openSUSE:Factory/.yast2-registration.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "yast2-registration" Thu Jan 24 14:00:45 2019 rev:28 rq:666784 version:4.1.14 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-registration/yast2-registration.changes 2018-12-31 09:44:03.346331278 +0100 +++ /work/SRC/openSUSE:Factory/.yast2-registration.new.28833/yast2-registration.changes 2019-01-24 14:00:47.096231426 +0100 @@ -1,0 +2,21 @@ +Thu Jan 17 15:08:40 UTC 2019 - lslezak@suse.cz + +- Save the current repository configuration so it is properly + restored after restarting the package manager (bsc#1122011) +- 4.1.14 + +------------------------------------------------------------------- +Wed Jan 16 08:53:13 UTC 2019 - lslezak@suse.cz + +- Do not crash when no base product to register is found + (bsc#1122011) +- 4.1.13 + +------------------------------------------------------------------- +Thu Jan 10 09:58:10 UTC 2019 - lslezak@suse.cz + +- Properly restart the package management to avoid using a possibly + outdated configuration (related to bsc#1120568) +- 4.1.12 + +------------------------------------------------------------------- Old: ---- yast2-registration-4.1.11.tar.bz2 New: ---- yast2-registration-4.1.14.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-registration.spec ++++++ --- /var/tmp/diff_new_pack.f999Sz/_old 2019-01-24 14:00:47.732230702 +0100 +++ /var/tmp/diff_new_pack.f999Sz/_new 2019-01-24 14:00:47.736230698 +0100 @@ -1,7 +1,7 @@ # # spec file for package yast2-registration # -# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: yast2-registration -Version: 4.1.11 +Version: 4.1.14 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build ++++++ yast2-registration-4.1.11.tar.bz2 -> yast2-registration-4.1.14.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-4.1.11/package/yast2-registration.changes new/yast2-registration-4.1.14/package/yast2-registration.changes --- old/yast2-registration-4.1.11/package/yast2-registration.changes 2018-12-14 14:25:06.000000000 +0100 +++ new/yast2-registration-4.1.14/package/yast2-registration.changes 2019-01-17 17:36:46.000000000 +0100 @@ -1,4 +1,25 @@ ------------------------------------------------------------------- +Thu Jan 17 15:08:40 UTC 2019 - lslezak@suse.cz + +- Save the current repository configuration so it is properly + restored after restarting the package manager (bsc#1122011) +- 4.1.14 + +------------------------------------------------------------------- +Wed Jan 16 08:53:13 UTC 2019 - lslezak@suse.cz + +- Do not crash when no base product to register is found + (bsc#1122011) +- 4.1.13 + +------------------------------------------------------------------- +Thu Jan 10 09:58:10 UTC 2019 - lslezak@suse.cz + +- Properly restart the package management to avoid using a possibly + outdated configuration (related to bsc#1120568) +- 4.1.12 + +------------------------------------------------------------------- Fri Dec 14 13:14:15 UTC 2018 - jlopez@suse.com - Hardening commands execution (part of bsc#1118291). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-4.1.11/package/yast2-registration.spec new/yast2-registration-4.1.14/package/yast2-registration.spec --- old/yast2-registration-4.1.11/package/yast2-registration.spec 2018-12-14 14:25:06.000000000 +0100 +++ new/yast2-registration-4.1.14/package/yast2-registration.spec 2019-01-17 17:36:46.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2-registration -Version: 4.1.11 +Version: 4.1.14 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-4.1.11/src/lib/registration/registration.rb new/yast2-registration-4.1.14/src/lib/registration/registration.rb --- old/yast2-registration-4.1.11/src/lib/registration/registration.rb 2018-12-14 14:25:06.000000000 +0100 +++ new/yast2-registration-4.1.14/src/lib/registration/registration.rb 2019-01-17 17:36:46.000000000 +0100 @@ -130,10 +130,18 @@ ret end + # Get the list of addons + # + # @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 + if !base_product + log.warn "No base product, skipping addons" + return [] + end + log.info "Reading available addons for product: #{base_product["name"]}" remote_product = SwMgmt.remote_product(base_product) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-4.1.11/src/lib/registration/sw_mgmt.rb new/yast2-registration-4.1.14/src/lib/registration/sw_mgmt.rb --- old/yast2-registration-4.1.11/src/lib/registration/sw_mgmt.rb 2018-12-14 14:25:06.000000000 +0100 +++ new/yast2-registration-4.1.14/src/lib/registration/sw_mgmt.rb 2019-01-17 17:36:46.000000000 +0100 @@ -655,7 +655,7 @@ # will use the old value from the upgraded system which might not # match the new target_distro from the media and might result in ignoring # service repositories (bsc#1094865) - options = { "target_distro" => target_distribution } + options = { "target_distro" => target_distribution(destdir) } Pkg.TargetInitializeOptions(destdir, options) else Pkg.TargetInitialize(destdir) @@ -663,8 +663,12 @@ end # get the target distribution for the new base product + # @param destdir [String] the target directory # @return [String] target distribution name or empty string if not found - def self.target_distribution + 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 @@ -672,6 +676,12 @@ target_distro = base_products ? base_products.first["register_target"] : "" log.info "Base product target distribution: #{target_distro.inspect}" + # 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 end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-registration-4.1.11/test/registration_spec.rb new/yast2-registration-4.1.14/test/registration_spec.rb --- old/yast2-registration-4.1.11/test/registration_spec.rb 2018-12-14 14:25:06.000000000 +0100 +++ new/yast2-registration-4.1.14/test/registration_spec.rb 2019-01-17 17:36:46.000000000 +0100 @@ -118,31 +118,41 @@ end describe "#get_addon_list" do - let(:base_product) do - { - "name" => "SLES", - "version" => "12", - "arch" => "x86_64", - "release_type" => "DVD" - } - end before do - expect(Registration::SwMgmt).to receive(:base_product_to_register).and_return(base_product) - end - - it "downloads available extensions" do remote_product = load_yaml_fixture("remote_product.yml") - expect(SUSE::Connect::YaST).to receive(:show_product).and_return(remote_product) + allow(SUSE::Connect::YaST).to receive(:show_product).and_return(remote_product) # no product renames defined - expect(Registration::SwMgmt).to receive(:update_product_renames).with({}) + allow(Registration::SwMgmt).to receive(:update_product_renames).with({}) + allow(Registration::SwMgmt).to receive(:base_product_to_register).and_return(base_product) + end + + context "no base product found" do + let(:base_product) { nil } + + it "returns empty list if no base product is found" do + expect(Registration::Registration.new.get_addon_list).to eq([]) + end + end + + context "a base product is found" do + let(:base_product) do + { + "name" => "SLES", + "version" => "12", + "arch" => "x86_64", + "release_type" => "DVD" + } + end - addons = Registration::Registration.new.get_addon_list + it "downloads available extensions" do + addons = Registration::Registration.new.get_addon_list - # HA-GEO is extension for HA so it's not included in the list - # also the base product must not be included in the list - expect(addons.map(&:identifier)).to include("sle-we", "sle-sdk", - "sle-module-legacy", "sle-module-web-scripting", "sle-module-public-cloud", - "sle-module-adv-systems-management", "sle-hae") + # HA-GEO is extension for HA so it's not included in the list + # also the base product must not be included in the list + expect(addons.map(&:identifier)).to include("sle-we", "sle-sdk", + "sle-module-legacy", "sle-module-web-scripting", "sle-module-public-cloud", + "sle-module-adv-systems-management", "sle-hae") + end end end