Hello community,

here is the log from the commit of package yast2-registration for 
openSUSE:Factory checked in at 2019-11-20 10:25:46
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-registration (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-registration.new.26869 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-registration"

Wed Nov 20 10:25:46 2019 rev:43 rq:746306 version:4.2.16

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-registration/yast2-registration.changes    
2019-10-27 13:36:16.768910923 +0100
+++ 
/work/SRC/openSUSE:Factory/.yast2-registration.new.26869/yast2-registration.changes
 2019-11-20 10:25:50.822545660 +0100
@@ -1,0 +2,13 @@
+Thu Nov  7 12:18:04 UTC 2019 - Ladislav Slezák <[email protected]>
+
+- Implement upgrade for Full medium (jsc#SLE-7101)
+- 4.2.16
+
+-------------------------------------------------------------------
+Wed Oct 30 16:31:12 UTC 2019 - Josef Reidinger <[email protected]>
+
+- Fix getting product for self-update for online and full medium
+  (bsc#1155420)
+- 4.2.15
+
+-------------------------------------------------------------------

Old:
----
  yast2-registration-4.2.14.tar.bz2

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

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

Other differences:
------------------
++++++ yast2-registration.spec ++++++
--- /var/tmp/diff_new_pack.tTDaVE/_old  2019-11-20 10:25:51.342545764 +0100
+++ /var/tmp/diff_new_pack.tTDaVE/_new  2019-11-20 10:25:51.342545764 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-registration
-Version:        4.2.14
+Version:        4.2.16
 Release:        0
 Summary:        YaST2 - Registration Module
 License:        GPL-2.0-only

++++++ yast2-registration-4.2.14.tar.bz2 -> yast2-registration-4.2.16.tar.bz2 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-registration-4.2.14/package/yast2-registration.changes 
new/yast2-registration-4.2.16/package/yast2-registration.changes
--- old/yast2-registration-4.2.14/package/yast2-registration.changes    
2019-10-25 16:27:29.000000000 +0200
+++ new/yast2-registration-4.2.16/package/yast2-registration.changes    
2019-11-07 15:55:52.000000000 +0100
@@ -1,4 +1,17 @@
 -------------------------------------------------------------------
+Thu Nov  7 12:18:04 UTC 2019 - Ladislav Slezák <[email protected]>
+
+- Implement upgrade for Full medium (jsc#SLE-7101)
+- 4.2.16
+
+-------------------------------------------------------------------
+Wed Oct 30 16:31:12 UTC 2019 - Josef Reidinger <[email protected]>
+
+- Fix getting product for self-update for online and full medium
+  (bsc#1155420)
+- 4.2.15
+
+-------------------------------------------------------------------
 Fri Oct 25 12:56:35 UTC 2019 - Josef Reidinger <[email protected]>
 
 - Upgrade support for the Online installation medium
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-registration-4.2.14/package/yast2-registration.spec 
new/yast2-registration-4.2.16/package/yast2-registration.spec
--- old/yast2-registration-4.2.14/package/yast2-registration.spec       
2019-10-25 16:27:29.000000000 +0200
+++ new/yast2-registration-4.2.16/package/yast2-registration.spec       
2019-11-07 15:55:52.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-registration
-Version:        4.2.14
+Version:        4.2.16
 Release:        0
 Summary:        YaST2 - Registration Module
 License:        GPL-2.0-only
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-registration-4.2.14/src/lib/registration/sw_mgmt.rb 
new/yast2-registration-4.2.16/src/lib/registration/sw_mgmt.rb
--- old/yast2-registration-4.2.14/src/lib/registration/sw_mgmt.rb       
2019-10-25 16:27:29.000000000 +0200
+++ new/yast2-registration-4.2.16/src/lib/registration/sw_mgmt.rb       
2019-11-07 15:55:52.000000000 +0100
@@ -133,7 +133,12 @@
     # given self_update_id is empty or there is no base product available
     def self.installer_update_base_product(self_update_id)
       return if self_update_id.empty?
-      base_product = Y2Packager::Product.available_base_products.first
+      # TODO: does offline makes sense for self update?
+      base_product = if Y2Packager::MediumType.online? || 
Y2Packager::MediumType.offline?
+        Y2Packager::ProductControlProduct.products.first
+      else
+        Y2Packager::Product.available_base_products.first
+      end
       return unless base_product
 
       # filter out not needed data
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-registration-4.2.14/src/lib/registration/ui/migration_repos_workflow.rb
 
new/yast2-registration-4.2.16/src/lib/registration/ui/migration_repos_workflow.rb
--- 
old/yast2-registration-4.2.14/src/lib/registration/ui/migration_repos_workflow.rb
   2019-10-25 16:27:29.000000000 +0200
+++ 
new/yast2-registration-4.2.16/src/lib/registration/ui/migration_repos_workflow.rb
   2019-11-07 15:55:52.000000000 +0100
@@ -12,9 +12,14 @@
 # 
------------------------------------------------------------------------------
 #
 
+require "pp"
+
 require "yast"
 require "yast2/popup"
+require "y2packager/medium_type"
+require "y2packager/product_location"
 require "y2packager/product_upgrade"
+require "y2packager/resolvable"
 
 require "registration/registration"
 require "registration/registration_ui"
@@ -41,6 +46,12 @@
       Yast.import "SourceDialogs"
       Yast.import "Linuxrc"
       Yast.import "Installation"
+      Yast.import "AddOnProduct"
+      Yast.import "InstURL"
+      Yast.import "Packages"
+      Yast.import "Pkg"
+      Yast.import "URL"
+      Yast.import "WorkflowManager"
 
       # the constructor
       def initialize
@@ -586,10 +597,17 @@
       # implicit media upgrade for an unregistered system
       def unregistered_media_upgrade
         log.info "The system is NOT registered, activating the media based 
upgrade"
-        # we do not support registering the old system at upgrade, that must
-        # be done before the upgrade, skip registration in that case
-        Yast::Popup.LongMessage(unregistered_message)
-        prepare_media_upgrade
+
+        if Y2Packager::MediumType.offline?
+          # Add the Full medium base product repository
+          # TODO: move somewhere else?
+          add_offline_base_product
+        else
+          # we do not support registering the old system at upgrade, that must
+          # be done before the upgrade, skip registration in that case
+          Yast::Popup.LongMessage(unregistered_message)
+          prepare_media_upgrade
+        end
       end
 
       def prepare_media_upgrade
@@ -600,6 +618,43 @@
         Yast::SourceDialogs.SetURL("dvd://")
       end
 
+      def add_offline_base_product
+        # in offline upgrade add the repository with the selected base product
+        # FIXME: similar to clients/inst_complex_welcome.rb and 
widgets/product_selector.rb
+        url = Yast::InstURL.installInf2Url("")
+        base_products = Y2Packager::ProductLocation
+                        .scan(url)
+                        .select { |p| p.details && p.details.base }
+        log.info "Found base products on the offline medium: 
#{base_products.pretty_inspect}"
+
+        # find the installed base product
+        installed_base = Y2Packager::Resolvable.find(
+          kind: :product, status: :installed, type: "base"
+        ).first
+        if !installed_base
+          log.error("Installed base product not found")
+          return
+        end
+
+        # FIXME: handle also the product renames
+        new_base = base_products.find { |p| p.details && p.details.product == 
installed_base.name }
+        if !new_base
+          log.error("New base product not found")
+          return
+        end
+
+        # FIXME: this is the same as in 
installation/widgets/product_selector.rb and other places
+        show_popup = true
+        log_url = Yast::URL.HidePassword(url)
+        Yast::Packages.Initialize_StageInitial(show_popup, url, log_url, 
new_base.dir)
+
+        # select the product to install
+        Yast::Pkg.ResolvableInstall(new_base.details && 
new_base.details.product, :product, "")
+        # initialize addons and the workflow manager
+        Yast::AddOnProduct.SetBaseProductURL(url)
+        Yast::WorkflowManager.SetBaseWorkflow(false)
+      end
+
       # Informative message
       # @return [String] translated message
       def unregistered_message
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-registration-4.2.14/test/migration_repos_workflow_spec.rb 
new/yast2-registration-4.2.16/test/migration_repos_workflow_spec.rb
--- old/yast2-registration-4.2.14/test/migration_repos_workflow_spec.rb 
2019-10-25 16:27:29.000000000 +0200
+++ new/yast2-registration-4.2.16/test/migration_repos_workflow_spec.rb 
2019-11-07 15:55:52.000000000 +0100
@@ -18,6 +18,7 @@
       allow(Yast::Stage).to receive(:initial).and_return(false)
       allow(Yast::Mode).to receive(:update).and_return(false)
       allow(Yast::Linuxrc).to receive(:InstallInf)
+      allow(Y2Packager::MediumType).to receive(:offline?).and_return(false)
     end
 
     shared_examples "media based upgrade" do |popup_method|
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-registration-4.2.14/test/sw_mgmt_spec.rb 
new/yast2-registration-4.2.16/test/sw_mgmt_spec.rb
--- old/yast2-registration-4.2.14/test/sw_mgmt_spec.rb  2019-10-25 
16:27:29.000000000 +0200
+++ new/yast2-registration-4.2.16/test/sw_mgmt_spec.rb  2019-11-07 
15:55:52.000000000 +0100
@@ -127,6 +127,8 @@
 
     before do
       allow(Y2Packager::Product).to 
receive(:available_base_products).and_return(available_products)
+      allow(Y2Packager::MediumType).to receive(:online?).and_return(false)
+      allow(Y2Packager::MediumType).to receive(:offline?).and_return(false)
     end
 
     it "returns nil if the given self_update_id is empty" do


Reply via email to