Hello community,

here is the log from the commit of package yast2-installation for 
openSUSE:Factory checked in at 2019-10-03 14:06:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-installation (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-installation.new.2352 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-installation"

Thu Oct  3 14:06:39 2019 rev:434 rq:734490 version:4.2.16

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-installation/yast2-installation.changes    
2019-09-30 15:53:19.650186093 +0200
+++ 
/work/SRC/openSUSE:Factory/.yast2-installation.new.2352/yast2-installation.changes
  2019-10-03 14:06:40.692529569 +0200
@@ -1,0 +2,6 @@
+Tue Oct  1 16:09:07 UTC 2019 - Ladislav Slezák <[email protected]>
+
+- Support for the offline installation medium (jsc#SLE-7101)
+- 4.2.16
+
+-------------------------------------------------------------------

Old:
----
  yast2-installation-4.2.15.tar.bz2

New:
----
  yast2-installation-4.2.16.tar.bz2

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

Other differences:
------------------
++++++ yast2-installation.spec ++++++
--- /var/tmp/diff_new_pack.N3T1E9/_old  2019-10-03 14:06:41.124528458 +0200
+++ /var/tmp/diff_new_pack.N3T1E9/_new  2019-10-03 14:06:41.124528458 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-installation
-Version:        4.2.15
+Version:        4.2.16
 Release:        0
 Summary:        YaST2 - Installation Parts
 License:        GPL-2.0-only

++++++ yast2-installation-4.2.15.tar.bz2 -> yast2-installation-4.2.16.tar.bz2 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-4.2.15/package/yast2-installation.changes 
new/yast2-installation-4.2.16/package/yast2-installation.changes
--- old/yast2-installation-4.2.15/package/yast2-installation.changes    
2019-09-25 11:11:37.000000000 +0200
+++ new/yast2-installation-4.2.16/package/yast2-installation.changes    
2019-10-02 09:55:53.000000000 +0200
@@ -1,4 +1,10 @@
 -------------------------------------------------------------------
+Tue Oct  1 16:09:07 UTC 2019 - Ladislav Slezák <[email protected]>
+
+- Support for the offline installation medium (jsc#SLE-7101)
+- 4.2.16
+
+-------------------------------------------------------------------
 Wed Sep 25 08:29:19 UTC 2019 - Steffen Winterfeldt <[email protected]>
 
 - do not stop haveged process (bsc#1140171)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-4.2.15/package/yast2-installation.spec 
new/yast2-installation-4.2.16/package/yast2-installation.spec
--- old/yast2-installation-4.2.15/package/yast2-installation.spec       
2019-09-25 11:11:37.000000000 +0200
+++ new/yast2-installation-4.2.16/package/yast2-installation.spec       
2019-10-02 09:55:53.000000000 +0200
@@ -16,7 +16,7 @@
 #
 
 Name:           yast2-installation
-Version:        4.2.15
+Version:        4.2.16
 Release:        0
 Group:          System/YaST
 License:        GPL-2.0-only
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-4.2.15/src/lib/installation/clients/inst_complex_welcome.rb
 
new/yast2-installation-4.2.16/src/lib/installation/clients/inst_complex_welcome.rb
--- 
old/yast2-installation-4.2.15/src/lib/installation/clients/inst_complex_welcome.rb
  2019-09-25 11:11:37.000000000 +0200
+++ 
new/yast2-installation-4.2.16/src/lib/installation/clients/inst_complex_welcome.rb
  2019-10-02 09:55:53.000000000 +0200
@@ -28,11 +28,14 @@
 require "y2packager/medium_type"
 require "y2packager/product"
 require "y2packager/product_control_product"
+require "y2packager/product_location"
+require "y2packager/product_sorter"
 
 Yast.import "Console"
 Yast.import "FileUtils"
 Yast.import "GetInstArgs"
 Yast.import "InstShowInfo"
+Yast.import "InstURL"
 Yast.import "Keyboard"
 Yast.import "Language"
 Yast.import "Mode"
@@ -172,13 +175,21 @@
     def available_base_products
       return @available_base_products if @available_base_products
 
-      if Y2Packager::MediumType.online?
+      case Y2Packager::MediumType.type
+      when :online
         # read the products from the control.xml
         @available_base_products = Y2Packager::ProductControlProduct.products
         log.info "Found base products in the control.xml: 
#{@available_base_products.pretty_inspect}"
 
         # we cannot continue, the control.xml in the installer is invalid
         raise "control.xml does not define any base products!" if 
@available_base_products.empty?
+      when :offline
+        url = InstURL.installInf2Url("")
+        @available_base_products = Y2Packager::ProductLocation
+                                   .scan(url)
+                                   .select { |p| p.details && p.details.base }
+                                   .sort(&::Y2Packager::PRODUCT_SORTER)
+        log.info "Found base products on the offline medium: 
#{@available_base_products.pretty_inspect}"
       else
         @available_base_products = Y2Packager::Product.available_base_products
       end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-4.2.15/src/lib/installation/widgets/product_selector.rb 
new/yast2-installation-4.2.16/src/lib/installation/widgets/product_selector.rb
--- 
old/yast2-installation-4.2.15/src/lib/installation/widgets/product_selector.rb  
    2019-09-25 11:11:37.000000000 +0200
+++ 
new/yast2-installation-4.2.16/src/lib/installation/widgets/product_selector.rb  
    2019-10-02 09:55:53.000000000 +0200
@@ -1,10 +1,12 @@
 require "yast"
 
+require "y2packager/medium_type"
 require "y2packager/product_control_product"
 
 Yast.import "Pkg"
 Yast.import "Popup"
 Yast.import "AddOnProduct"
+Yast.import "WorkflowManager"
 
 require "cwm/common_widgets"
 
@@ -35,7 +37,9 @@
 
       def init
         selected = products.find(&:selected?)
-        disable if registered?
+        # disable changing the base product after registering it, in the 
offline
+        # installation we cannot easily change the base product repository
+        disable if registered? || offline_product_selected?
         return unless selected
 
         self.value = item_id(selected)
@@ -48,8 +52,21 @@
 
         return unless @product
 
+        # online product from control.xml
         if @product.is_a?(Y2Packager::ProductControlProduct)
           Y2Packager::ProductControlProduct.selected = @product
+        # offline product from the medium repository
+        elsif @product.is_a?(Y2Packager::ProductLocation)
+          # in offline installation add the repository with the selected base 
product
+          show_popup = true
+          base_url = Yast::InstURL.installInf2Url("")
+          log_url = Yast::URL.HidePassword(base_url)
+          Yast::Packages.Initialize_StageInitial(show_popup, base_url, 
log_url, @product.dir)
+          # select the product to install
+          Yast::Pkg.ResolvableInstall(@product.details && 
@product.details.product, :product, "")
+          # initialize addons and the workflow manager
+          Yast::AddOnProduct.SetBaseProductURL(base_url)
+          Yast::WorkflowManager.SetBaseWorkflow(false)
         else
           # reset both YaST and user selection (when going back or any products
           # selected by YaST in the previous steps)
@@ -87,7 +104,16 @@
         false
       end
 
+      # has been an offline installation product selected?
+      # @return [Boolean] true if an offline installation product has been 
selected
+      def offline_product_selected?
+        Y2Packager::MediumType.offline? && products.any?(&:selected?)
+      end
+
+      # unique widget ID for the product
+      # @return [String] widget ID
       def item_id(prod)
+        return prod.dir if prod.is_a?(Y2Packager::ProductLocation)
         "#{prod.name}-#{prod.version}-#{prod.arch}"
       end
     end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-4.2.15/test/lib/clients/inst_complex_welcome_test.rb 
new/yast2-installation-4.2.16/test/lib/clients/inst_complex_welcome_test.rb
--- old/yast2-installation-4.2.15/test/lib/clients/inst_complex_welcome_test.rb 
2019-09-25 11:11:37.000000000 +0200
+++ new/yast2-installation-4.2.16/test/lib/clients/inst_complex_welcome_test.rb 
2019-10-02 09:55:53.000000000 +0200
@@ -69,7 +69,7 @@
     allow(Y2Packager::Product).to receive(:selected_base).and_return(product)
     allow(Y2Packager::Product).to 
receive(:available_base_products).and_return(products)
     allow(Y2Packager::Product).to 
receive(:forced_base_product).and_return(forced_base_product)
-    allow(Y2Packager::MediumType).to receive(:online?).and_return(false)
+    allow(Y2Packager::MediumType).to receive(:type).and_return(:standard)
   end
 
   describe "#main" do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-installation-4.2.15/test/widgets/product_selector_test.rb 
new/yast2-installation-4.2.16/test/widgets/product_selector_test.rb
--- old/yast2-installation-4.2.15/test/widgets/product_selector_test.rb 
2019-09-25 11:11:37.000000000 +0200
+++ new/yast2-installation-4.2.16/test/widgets/product_selector_test.rb 
2019-10-02 09:55:53.000000000 +0200
@@ -12,6 +12,10 @@
 
   include_examples "CWM::RadioButtons"
 
+  before do
+    allow(Y2Packager::MediumType).to receive(:offline?).and_return(false)
+  end
+
   describe "#init" do
     let(:registration) { double("Registration::Registration", is_registered?: 
registered?) }
 
@@ -51,6 +55,20 @@
         subject.init
       end
     end
+
+    context "when an offline base product has been selected" do
+      let(:registered?) { false }
+
+      before do
+        expect(Y2Packager::MediumType).to receive(:offline?).and_return(true)
+        expect(product1).to 
receive(:selected?).and_return(true).at_least(:once)
+      end
+
+      it "disables the widget" do
+        expect(subject).to receive(:disable)
+        subject.init
+      end
+    end
   end
 
   describe "#store" do
@@ -82,5 +100,29 @@
         .with("add-on-product", :product, "")
       subject.store
     end
+
+    context "offline installation medium" do
+      let(:offline_product) { Y2Packager::ProductLocation.new("product", 
"dir") }
+      let(:url) { "http://example.com"; }
+
+      before do
+        allow(offline_product).to receive(:selected?).and_return(true)
+        allow(Yast::InstURL).to receive(:installInf2Url).and_return(url)
+        allow(Yast::Packages).to receive(:Initialize_StageInitial)
+        allow(Yast::Pkg).to receive(:ResolvableInstall)
+        allow(Yast::AddOnProduct).to receive(:SetBaseProductURL)
+        allow(Yast::WorkflowManager).to receive(:SetBaseWorkflow)
+      end
+
+      it "adds the product repository" do
+        expect(Yast::Packages).to receive(:Initialize_StageInitial)
+          .with(true, url, url, "dir")
+
+        product_selector = described_class.new([offline_product])
+        allow(product_selector).to receive(:value).and_return("dir")
+        product_selector.init
+        product_selector.store
+      end
+    end
   end
 end


Reply via email to