Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package yast2-add-on for openSUSE:Factory 
checked in at 2021-09-04 22:32:14
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-add-on (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-add-on.new.1899 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-add-on"

Sat Sep  4 22:32:14 2021 rev:115 rq:915784 version:4.4.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-add-on/yast2-add-on.changes        
2021-08-26 23:14:31.452262180 +0200
+++ /work/SRC/openSUSE:Factory/.yast2-add-on.new.1899/yast2-add-on.changes      
2021-09-04 22:32:38.735936058 +0200
@@ -1,0 +2,7 @@
+Tue Aug 31 11:15:52 UTC 2021 - David Diaz <dgonza...@suse.com>
+
+- Auto client does not crash when trying to import from an
+  empty add-on section (bsc#1189154).
+- 4.4.2
+
+-------------------------------------------------------------------

Old:
----
  yast2-add-on-4.4.1.tar.bz2

New:
----
  yast2-add-on-4.4.2.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ yast2-add-on.spec ++++++
--- /var/tmp/diff_new_pack.LTZLBc/_old  2021-09-04 22:32:39.755937408 +0200
+++ /var/tmp/diff_new_pack.LTZLBc/_new  2021-09-04 22:32:39.759937413 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-add-on
-Version:        4.4.1
+Version:        4.4.2
 Release:        0
 Summary:        YaST2 - Add-On media installation code
 License:        GPL-2.0-only

++++++ yast2-add-on-4.4.1.tar.bz2 -> yast2-add-on-4.4.2.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-add-on-4.4.1/package/yast2-add-on.changes 
new/yast2-add-on-4.4.2/package/yast2-add-on.changes
--- old/yast2-add-on-4.4.1/package/yast2-add-on.changes 2021-08-24 
11:03:20.000000000 +0200
+++ new/yast2-add-on-4.4.2/package/yast2-add-on.changes 2021-08-31 
13:26:58.000000000 +0200
@@ -1,4 +1,11 @@
 -------------------------------------------------------------------
+Tue Aug 31 11:15:52 UTC 2021 - David Diaz <dgonza...@suse.com>
+
+- Auto client does not crash when trying to import from an
+  empty add-on section (bsc#1189154).
+- 4.4.2
+
+-------------------------------------------------------------------
 Thu Aug 19 16:00:54 UTC 2021 - David Diaz <dgonza...@suse.com>
 
 - Improve UX by using a less misleading message when
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-add-on-4.4.1/package/yast2-add-on.spec 
new/yast2-add-on-4.4.2/package/yast2-add-on.spec
--- old/yast2-add-on-4.4.1/package/yast2-add-on.spec    2021-08-24 
11:03:20.000000000 +0200
+++ new/yast2-add-on-4.4.2/package/yast2-add-on.spec    2021-08-31 
13:26:58.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-add-on
-Version:        4.4.1
+Version:        4.4.2
 Release:        0
 Summary:        YaST2 - Add-On media installation code
 License:        GPL-2.0-only
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-add-on-4.4.1/src/lib/add-on/clients/add-on_auto.rb 
new/yast2-add-on-4.4.2/src/lib/add-on/clients/add-on_auto.rb
--- old/yast2-add-on-4.4.1/src/lib/add-on/clients/add-on_auto.rb        
2021-08-24 11:03:20.000000000 +0200
+++ new/yast2-add-on-4.4.2/src/lib/add-on/clients/add-on_auto.rb        
2021-08-31 13:26:58.000000000 +0200
@@ -1,3 +1,22 @@
+# Copyright (c) [2018-2021] SUSE LLC
+#
+# All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of version 2 of the GNU General Public License as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, contact SUSE LLC.
+#
+# To contact SUSE LLC about this file by physical or electronic mail, you may
+# find current contact information at www.suse.com.
+
 require "yast"
 require "installation/auto_client"
 
@@ -25,6 +44,8 @@
     end
 
     def import(data)
+      return true if data.nil?
+
       add_ons = data.fetch("add_on_products", [])
       # Add-on products have the same format as add-ons which have been
       # added manually by the user. So we can take the same workflow here.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-add-on-4.4.1/test/y2add_on/clients/add-on_auto_test.rb 
new/yast2-add-on-4.4.2/test/y2add_on/clients/add-on_auto_test.rb
--- old/yast2-add-on-4.4.1/test/y2add_on/clients/add-on_auto_test.rb    
2021-08-24 11:03:20.000000000 +0200
+++ new/yast2-add-on-4.4.2/test/y2add_on/clients/add-on_auto_test.rb    
2021-08-31 13:26:58.000000000 +0200
@@ -1,26 +1,51 @@
 #!/usr/bin/env rspec
 
+# Copyright (c) [2018-2021] SUSE LLC
+#
+# All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or modify it
+# under the terms of version 2 of the GNU General Public License as published
+# by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, contact SUSE LLC.
+#
+# To contact SUSE LLC about this file by physical or electronic mail, you may
+# find current contact information at www.suse.com.
+
 require_relative "../../test_helper"
 require "add-on/clients/add-on_auto"
 
 Yast.import "Packages"
 
 describe Yast::AddOnAutoClient do
+  subject(:client) { described_class.new }
+
   describe "#import" do
     let(:params) do
       { "add_on_products" => add_on_products,
         "add_on_others"   => add_on_others }
     end
 
-    context "when 'add_on_products' param is NOT given" do
-      it "sets 'add_on_products' to empty array" do
-        expect(Yast::AddOnProduct).to receive(:Import).with("add_on_products" 
=> [])
+    context "when no data is given" do
+      it "does not try to import add-on products" do
+        expect(Yast::AddOnProduct).to_not receive(:Import)
+
+        client.import(nil)
+      end
 
-        subject.import(something: nil)
+      it "returns true" do
+        expect(client.import(nil)).to eq(true)
       end
     end
 
-    context "when completly valid 'add_on_products' param is given" do
+    context "when given data only contains valid add-ons" do
       let(:add_on_products) do
         [
           {
@@ -50,11 +75,11 @@
           "add_on_products" => add_on_products + add_on_others
         )
 
-        subject.import(params)
+        client.import(params)
       end
     end
 
-    context "when there are missed media_url values in given 
'add_on_products'" do
+    context "when given data contains a not valid add-on" do
       let(:add_on_products) do
         [
           {
@@ -91,7 +116,7 @@
       it "asks to user about reject them" do
         expect(Yast::Popup).to 
receive(:ContinueCancel).with(missed_media_url_error)
 
-        subject.import(params)
+        client.import(params)
       end
 
       it "rejects them if user decides to continue" do
@@ -99,7 +124,7 @@
 
         expect(Yast::AddOnProduct).to receive(:Import).with("add_on_products" 
=> valid_add_on_products)
 
-        subject.import(params)
+        client.import(params)
       end
 
       it "returns false (does nothing) if user decides to abort" do
@@ -159,7 +184,7 @@
     it "returns an unordered list sumarizing current add_on_product" do
       allow(Yast::AddOnProduct).to 
receive(:add_on_products).and_return(add_on_products)
 
-      expect(subject.summary).to eq(expected_output)
+      expect(client.summary).to eq(expected_output)
     end
   end
 
@@ -170,7 +195,7 @@
       end
 
       it "returns true" do
-        expect(subject.modified?).to be_truthy
+        expect(client.modified?).to be_truthy
       end
     end
 
@@ -180,7 +205,7 @@
       end
 
       it "returns true" do
-        expect(subject.modified?).to be_falsey
+        expect(client.modified?).to be_falsey
       end
     end
   end
@@ -189,7 +214,7 @@
     it "sets configuration as changed" do
       allow(Yast::AddOnProduct).to receive(:modified=).with(true)
 
-      subject.modified
+      client.modified
     end
   end
 
@@ -197,7 +222,7 @@
     it "resets configuration" do
       allow(Yast::AddOnProduct).to receive(:add_on_products=).with([])
 
-      subject.reset
+      client.reset
     end
   end
 
@@ -208,15 +233,15 @@
     end
 
     it "runs add-on main dialog" do
-      expect(subject).to receive(:RunAddOnMainDialog)
+      expect(client).to receive(:RunAddOnMainDialog)
 
-      subject.change
+      client.change
     end
 
     it "returns chosen action" do
-      allow(subject).to receive(:RunAddOnMainDialog).and_return(:next)
+      allow(client).to receive(:RunAddOnMainDialog).and_return(:next)
 
-      expect(subject.change).to be(:next)
+      expect(client.change).to be(:next)
     end
   end
 
@@ -244,21 +269,21 @@
       expect(Yast::AddOnProduct).to 
receive(:Export).and_return(add_on_products)
       expect(Yast::AddOnOthers).to receive(:Export).and_return(add_on_others)
 
-      expect(subject.export).to eq(add_on_products.merge(add_on_others))
+      expect(client.export).to eq(add_on_products.merge(add_on_others))
     end
 
     it "returns just non empty type of addons" do
       expect(Yast::AddOnProduct).to 
receive(:Export).and_return(add_on_products)
       expect(Yast::AddOnOthers).to receive(:Export).and_return({})
 
-      expect(subject.export).to eq(add_on_products)
+      expect(client.export).to eq(add_on_products)
     end
 
     it "returns empty hash if all types are empty" do
       expect(Yast::AddOnProduct).to receive(:Export).and_return({})
       expect(Yast::AddOnOthers).to receive(:Export).and_return({})
 
-      expect(subject.export).to eq({})
+      expect(client.export).to eq({})
     end
   end
 
@@ -351,7 +376,7 @@
             # stop retrying and the error is finally displayed
             allow(Yast::Report).to receive(:Error)
 
-            subject.write
+            client.write
           end
         end
 
@@ -365,7 +390,7 @@
           it "reports the error" do
             expect(Yast::Report).to receive(:Error)
 
-            subject.write
+            client.write
           end
         end
       end
@@ -373,13 +398,13 @@
       it "stores repos according to information given" do
         expect(Yast::Pkg).to receive(:SourceEditSet).with(repos_to_store)
 
-        subject.write
+        client.write
       end
 
       it "releases the media accessors" do
         expect(Yast::Pkg).to receive(:SourceReleaseAll)
 
-        subject.write
+        client.write
       end
     end
   end
@@ -391,7 +416,7 @@
       end
 
       it "returns false" do
-        expect(subject.read).to be_falsey
+        expect(client.read).to be_falsey
       end
     end
 
@@ -402,9 +427,9 @@
       end
 
       it "reads add-ons configuration from the current system" do
-        expect(subject).to receive(:ReadFromSystem)
+        expect(client).to receive(:ReadFromSystem)
 
-        subject.read
+        client.read
       end
     end
   end

Reply via email to