Hello community,

here is the log from the commit of package yast2-add-on for openSUSE:Factory 
checked in at 2018-01-17 21:43:00
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-add-on (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-add-on.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-add-on"

Wed Jan 17 21:43:00 2018 rev:88 rq:562508 version:4.0.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-add-on/yast2-add-on.changes        
2017-12-29 18:47:20.794295217 +0100
+++ /work/SRC/openSUSE:Factory/.yast2-add-on.new/yast2-add-on.changes   
2018-01-17 21:43:01.870116613 +0100
@@ -1,0 +2,6 @@
+Mon Jan  8 10:57:47 UTC 2018 - lsle...@suse.cz
+
+- Fixed a crash when when adding an addon (bsc#1074766)
+- 4.0.5
+
+-------------------------------------------------------------------

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

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

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

Other differences:
------------------
++++++ yast2-add-on.spec ++++++
--- /var/tmp/diff_new_pack.qBOLGn/_old  2018-01-17 21:43:02.442089839 +0100
+++ /var/tmp/diff_new_pack.qBOLGn/_new  2018-01-17 21:43:02.442089839 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package yast2-add-on
 #
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 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-add-on
-Version:        4.0.4
+Version:        4.0.5
 Release:        0
 Summary:        YaST2 - Add-On media installation code
 License:        GPL-2.0
@@ -35,8 +35,8 @@
 Requires:       yast2 >= 3.0.1
 Requires:       yast2-country
 Requires:       yast2-installation
-# SourceDialogs.display_addon_checkbox
-Requires:       yast2-packager >= 3.1.14
+# new AddOnProduct.DoInstall argument
+Requires:       yast2-packager >= 4.0.25
 Requires:       yast2-ruby-bindings >= 1.0.0
 
 Obsoletes:      yast2-add-on-devel-doc

++++++ yast2-add-on-4.0.4.tar.bz2 -> yast2-add-on-4.0.5.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-add-on-4.0.4/package/yast2-add-on.changes 
new/yast2-add-on-4.0.5/package/yast2-add-on.changes
--- old/yast2-add-on-4.0.4/package/yast2-add-on.changes 2017-12-20 
16:56:32.000000000 +0100
+++ new/yast2-add-on-4.0.5/package/yast2-add-on.changes 2018-01-08 
14:05:15.000000000 +0100
@@ -1,4 +1,10 @@
 -------------------------------------------------------------------
+Mon Jan  8 10:57:47 UTC 2018 - lsle...@suse.cz
+
+- Fixed a crash when when adding an addon (bsc#1074766)
+- 4.0.5
+
+-------------------------------------------------------------------
 Wed Dec 20 16:08:43 CET 2017 - sch...@suse.de
 
 - Improved error message for adding a product. (bnc#1071173)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-add-on-4.0.4/package/yast2-add-on.spec 
new/yast2-add-on-4.0.5/package/yast2-add-on.spec
--- old/yast2-add-on-4.0.4/package/yast2-add-on.spec    2017-12-20 
16:56:32.000000000 +0100
+++ new/yast2-add-on-4.0.5/package/yast2-add-on.spec    2018-01-08 
14:05:15.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-add-on
-Version:        4.0.4
+Version:        4.0.5
 Release:        0
 Summary:        YaST2 - Add-On media installation code
 License:        GPL-2.0
@@ -35,8 +35,8 @@
 Requires:       yast2 >= 3.0.1
 Requires:       yast2-country
 Requires:       yast2-installation
-# SourceDialogs.display_addon_checkbox
-Requires:       yast2-packager >= 3.1.14
+# new AddOnProduct.DoInstall argument
+Requires:       yast2-packager >= 4.0.25
 Requires:       yast2-ruby-bindings >= 1.0.0
 
 Obsoletes:      yast2-add-on-devel-doc
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-add-on-4.0.4/src/include/add-on/add-on-workflow.rb 
new/yast2-add-on-4.0.5/src/include/add-on/add-on-workflow.rb
--- old/yast2-add-on-4.0.4/src/include/add-on/add-on-workflow.rb        
2017-12-20 16:56:32.000000000 +0100
+++ new/yast2-add-on-4.0.5/src/include/add-on/add-on-workflow.rb        
2018-01-08 14:05:15.000000000 +0100
@@ -1751,7 +1751,32 @@
 
     def RunAddProductWorkflow
       WFM.CallFunction("inst_addon_update_sources", [])
-      AddOnProduct.DoInstall
+
+      # partition the addons into two groups:
+      # - plain addons (no installation.xml)
+      # - addons with installation.xml
+      # handle each group separately
+      plain_addons, workflow_addons = @added_repos.partition do |repo|
+        WorkflowManager.GetCachedWorkflowFilename(:addon, repo, "").nil?
+      end
+
+      plain_addons.each do |repo|
+        # the src_id value must be set before calling DoInstall
+        AddOnProduct.src_id = repo
+        # just handle each repository separately, select the packages but do 
not
+        # install them yet
+        AddOnProduct.DoInstall(install_packages: false)
+      end
+
+      # install all packages at once
+      AddOnProduct.DoInstall_NoControlFile unless plain_addons.empty?
+
+      workflow_addons.each do |repo|
+        AddOnProduct.src_id = repo
+        # run the installation.xml
+        AddOnProduct.DoInstall
+      end
+
       # Write only when there are some changes
       Write()
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-add-on-4.0.4/test/repositories_include_test.rb 
new/yast2-add-on-4.0.5/test/repositories_include_test.rb
--- old/yast2-add-on-4.0.4/test/repositories_include_test.rb    2017-12-20 
16:56:32.000000000 +0100
+++ new/yast2-add-on-4.0.5/test/repositories_include_test.rb    2018-01-08 
14:05:15.000000000 +0100
@@ -105,4 +105,27 @@
       end
     end
   end
+
+  describe "#RunAddProductWorkflow" do
+    before do
+      allow(Yast::WFM).to 
receive(:CallFunction).with("inst_addon_update_sources", [])
+      allow(Yast::Pkg).to receive(:SourceReleaseAll)
+      allow(AddonIncludeTester).to receive(:Write)
+      AddonIncludeTester.instance_variable_set("@added_repos", [1, 2])
+    end
+
+    it "installs the selected products at once" do
+      expect(Yast::WorkflowManager).to 
receive(:GetCachedWorkflowFilename).and_return(nil).twice
+      expect(Yast::AddOnProduct).to receive(:DoInstall).with(install_packages: 
false).twice
+      expect(Yast::AddOnProduct).to receive(:DoInstall_NoControlFile)
+      AddonIncludeTester.RunAddProductWorkflow
+    end
+
+    it "handles addons with installation.xml" do
+      expect(Yast::WorkflowManager).to 
receive(:GetCachedWorkflowFilename).and_return("foo").twice
+      expect(Yast::AddOnProduct).to receive(:DoInstall).twice
+      expect(Yast::AddOnProduct).to_not receive(:DoInstall_NoControlFile)
+      AddonIncludeTester.RunAddProductWorkflow
+    end
+  end
 end


Reply via email to