diff --git a/package/yast2-registration.changes b/package/yast2-registration.changes index 26d885545..5bdfdafb8 100644 --- a/package/yast2-registration.changes +++ b/package/yast2-registration.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Fri Aug 31 10:12:16 UTC 2018 - lslezak@suse.cz + +- Better check the not installed addon products, some specific + repositories do not provide any product +- Fixes online migration on PPC (bsc#1103412) +- 4.0.44 + ------------------------------------------------------------------- Wed Jul 18 10:45:15 CEST 2018 - schubi@suse.de diff --git a/package/yast2-registration.spec b/package/yast2-registration.spec index f0b1e4431..f1e06f488 100644 --- a/package/yast2-registration.spec +++ b/package/yast2-registration.spec @@ -17,7 +17,7 @@ Name: yast2-registration -Version: 4.0.43 +Version: 4.0.44 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -54,7 +54,7 @@ BuildRequires: update-desktop-files BuildRequires: yast2-devtools >= 3.1.39 BuildRequires: rubygem(yast-rake) >= 0.2.5 BuildRequires: rubygem(rspec) -BuildRequires: rubygem(suse-connect) >= 0.2.22 +BuildRequires: rubygem(suse-connect) >= 0.3.11 BuildRequires: yast2-slp >= 3.1.9 # updated product renames BuildRequires: yast2-packager >= 4.0.40 diff --git a/src/lib/registration/addon.rb b/src/lib/registration/addon.rb index ac939f64d..f6f161ddb 100644 --- a/src/lib/registration/addon.rb +++ b/src/lib/registration/addon.rb @@ -71,14 +71,21 @@ def auto_selected end # return add-ons which are registered but not installed in the system + # and are available to install # @return [Array] the list of add-ons def registered_not_installed registered.select do |addon| - !SwMgmt.installed_products.find do |product| + installed = SwMgmt.installed_products.find do |product| product["name"] == addon.identifier && product["version_version"] == addon.version && product["arch"] == addon.arch end + + available = Yast::Pkg.ResolvableProperties(addon.identifier, :product, "").find do |p| + p["status"] == :available + end + + !installed && available end end diff --git a/test/addon_spec.rb b/test/addon_spec.rb index 585591373..9a7fe49b4 100644 --- a/test/addon_spec.rb +++ b/test/addon_spec.rb @@ -119,11 +119,29 @@ addon2 = addons.find { |addon| addon.name == "prod2" } expect(Registration::SwMgmt).to receive(:installed_products).and_return([]) + expect(Yast::Pkg).to receive(:ResolvableProperties).with(prod2.identifier, :product, "") + .and_return(["status" => :available]) reg_not_installed_addons = Registration::Addon.registered_not_installed expect(reg_not_installed_addons.size).to eql(1) expect(reg_not_installed_addons.first.name).to eql(addon2.name) end + + it "does not return addons without available products" do + prod = addon_generator("name" => "prod") + registration = double( + activated_products: [prod], + get_addon_list: [prod] + ) + + Registration::Addon.find_all(registration) + + expect(Registration::SwMgmt).to receive(:installed_products).and_return([]) + expect(Yast::Pkg).to receive(:ResolvableProperties).with(prod.identifier, :product, "") + .and_return([]) + + expect(Registration::Addon.registered_not_installed).to be_empty + end end describe "#unregistered" do