Hello community,

here is the log from the commit of package yast2-registration for 
openSUSE:Factory checked in at 2019-09-23 13:16:51
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-registration (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-registration.new.7948 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-registration"

Mon Sep 23 13:16:51 2019 rev:39 rq:732160 version:4.2.8

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-registration/yast2-registration.changes    
2019-08-27 10:17:05.919956701 +0200
+++ 
/work/SRC/openSUSE:Factory/.yast2-registration.new.7948/yast2-registration.changes
  2019-09-23 13:16:52.653110767 +0200
@@ -1,0 +2,6 @@
+Fri Sep 20 09:27:04 UTC 2019 - Ladislav Slezák <[email protected]>
+
+- Support for the online installation medium (jsc#SLE-7214)
+- 4.2.8
+
+-------------------------------------------------------------------

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

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

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

Other differences:
------------------
++++++ yast2-registration.spec ++++++
--- /var/tmp/diff_new_pack.bT8QKQ/_old  2019-09-23 13:16:53.101110686 +0200
+++ /var/tmp/diff_new_pack.bT8QKQ/_new  2019-09-23 13:16:53.101110686 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-registration
-Version:        4.2.7
+Version:        4.2.8
 Release:        0
 Summary:        YaST2 - Registration Module
 License:        GPL-2.0-only
@@ -26,20 +26,20 @@
 
 Source0:        %{name}-%{version}.tar.bz2
 
-# Y2Packager::ProductLicense
 BuildRequires:  update-desktop-files
-BuildRequires:  yast2 >= 4.0.63
+# Y2Packager::ProductControlProduct
+BuildRequires:  yast2 >= 4.2.22
 BuildRequires:  yast2-devtools >= 4.2.2
 BuildRequires:  yast2-slp >= 3.1.9
 BuildRequires:  rubygem(%{rb_default_ruby_abi}:rspec)
 BuildRequires:  rubygem(%{rb_default_ruby_abi}:suse-connect) >= 0.3.11
 BuildRequires:  rubygem(%{rb_default_ruby_abi}:yast-rake) >= 0.2.5
-# updated product renames
-BuildRequires:  yast2-packager >= 4.0.40
+# Y2Packager::MediumType
+BuildRequires:  yast2-packager >= 4.2.27
 BuildRequires:  yast2-update >= 3.1.36
 
-# Y2Packager::ProductLicense
-Requires:       yast2 >= 4.0.63
+# Y2Packager::ProductControlProduct
+Requires:       yast2 >= 4.2.22
 # "dupAllowVendorChange" option in Pkg.SetSolverFlags()
 Requires:       yast2-pkg-bindings >= 3.1.34
 # N_() method
@@ -54,8 +54,8 @@
 Requires:       SUSEConnect >= 0.2.37
 Requires:       yast2-add-on >= 3.1.8
 Requires:       yast2-slp >= 3.1.9
-# Packager ProductLicense#HandleLicenseDialogRet allowing "refuse" action
-Requires:       yast2-packager >= 4.2.16
+# Y2Packager::MediumType
+Requires:       yast2-packager >= 4.2.27
 Requires:       yast2-update >= 3.1.36
 
 BuildArch:      noarch

++++++ yast2-registration-4.2.7.tar.bz2 -> yast2-registration-4.2.8.tar.bz2 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-registration-4.2.7/package/yast2-registration.changes 
new/yast2-registration-4.2.8/package/yast2-registration.changes
--- old/yast2-registration-4.2.7/package/yast2-registration.changes     
2019-08-22 17:18:15.000000000 +0200
+++ new/yast2-registration-4.2.8/package/yast2-registration.changes     
2019-09-20 14:20:27.000000000 +0200
@@ -1,4 +1,10 @@
 -------------------------------------------------------------------
+Fri Sep 20 09:27:04 UTC 2019 - Ladislav Slezák <[email protected]>
+
+- Support for the online installation medium (jsc#SLE-7214)
+- 4.2.8
+
+-------------------------------------------------------------------
 Thu Aug 22 16:54:42 CEST 2019 - [email protected]
 
 - Using rb_default_ruby_abi tag in the spec file in order to
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-registration-4.2.7/package/yast2-registration.spec 
new/yast2-registration-4.2.8/package/yast2-registration.spec
--- old/yast2-registration-4.2.7/package/yast2-registration.spec        
2019-08-22 17:18:15.000000000 +0200
+++ new/yast2-registration-4.2.8/package/yast2-registration.spec        
2019-09-20 14:20:27.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-registration
-Version:        4.2.7
+Version:        4.2.8
 Release:        0
 Summary:        YaST2 - Registration Module
 License:        GPL-2.0-only
@@ -26,20 +26,20 @@
 
 Source0:        %{name}-%{version}.tar.bz2
 
-# Y2Packager::ProductLicense
 BuildRequires:  update-desktop-files
-BuildRequires:  yast2 >= 4.0.63
+# Y2Packager::ProductControlProduct
+BuildRequires:  yast2 >= 4.2.22
 BuildRequires:  yast2-devtools >= 4.2.2
 BuildRequires:  yast2-slp >= 3.1.9
 BuildRequires:  rubygem(%{rb_default_ruby_abi}:rspec)
 BuildRequires:  rubygem(%{rb_default_ruby_abi}:suse-connect) >= 0.3.11
 BuildRequires:  rubygem(%{rb_default_ruby_abi}:yast-rake) >= 0.2.5
-# updated product renames
-BuildRequires:  yast2-packager >= 4.0.40
+# Y2Packager::MediumType
+BuildRequires:  yast2-packager >= 4.2.27
 BuildRequires:  yast2-update >= 3.1.36
 
-# Y2Packager::ProductLicense
-Requires:       yast2 >= 4.0.63
+# Y2Packager::ProductControlProduct
+Requires:       yast2 >= 4.2.22
 # "dupAllowVendorChange" option in Pkg.SetSolverFlags()
 Requires:       yast2-pkg-bindings >= 3.1.34
 # N_() method
@@ -54,8 +54,8 @@
 Requires:       SUSEConnect >= 0.2.37
 Requires:       yast2-add-on >= 3.1.8
 Requires:       yast2-slp >= 3.1.9
-# Packager ProductLicense#HandleLicenseDialogRet allowing "refuse" action
-Requires:       yast2-packager >= 4.2.16
+# Y2Packager::MediumType
+Requires:       yast2-packager >= 4.2.27
 Requires:       yast2-update >= 3.1.36
 
 BuildArch:      noarch
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-registration-4.2.7/src/lib/registration/clients/inst_scc.rb 
new/yast2-registration-4.2.8/src/lib/registration/clients/inst_scc.rb
--- old/yast2-registration-4.2.7/src/lib/registration/clients/inst_scc.rb       
2019-08-22 17:18:15.000000000 +0200
+++ new/yast2-registration-4.2.8/src/lib/registration/clients/inst_scc.rb       
2019-09-20 14:20:27.000000000 +0200
@@ -44,6 +44,8 @@
 require "registration/ui/registration_update_dialog"
 require "registration/ui/media_addon_workflow"
 
+require "y2packager/medium_type"
+
 # TODO: move to the "Registration" name space
 module Yast
   class InstSccClient < Client
@@ -54,6 +56,11 @@
     CONTACTING_MESSAGE = N_("Contacting the Registration Server")
 
     def main
+      if Y2Packager::MediumType.skip_step?
+        log.info "Skipping the client on the #{Y2Packager::MediumType.type} 
medium"
+        return :auto
+      end
+
       textdomain "registration"
       import_modules
 
@@ -182,8 +189,11 @@
       # Go back if the user clicked 'back' in the registration dialog
       return :back if @back_from_register
 
-      # check the base product at start to avoid problems later
-      if ::Registration::SwMgmt.find_base_product.nil?
+      # check the base product at start to avoid problems later,
+      # skip the check on the online medium, it does not contain any repo (or 
a base product)
+      if !(Stage.initial && Y2Packager::MediumType.online?) &&
+          ::Registration::SwMgmt.find_base_product.nil?
+
         ::Registration::Helpers.report_no_base_product
         return Mode.normal ? :abort : :auto
       end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-registration-4.2.7/src/lib/registration/registration.rb 
new/yast2-registration-4.2.8/src/lib/registration/registration.rb
--- old/yast2-registration-4.2.7/src/lib/registration/registration.rb   
2019-08-22 17:18:15.000000000 +0200
+++ new/yast2-registration-4.2.8/src/lib/registration/registration.rb   
2019-09-20 14:20:27.000000000 +0200
@@ -51,6 +51,7 @@
         email: email
       )
 
+      log.info "Announcing system with distro_target: #{distro_target}"
       login, password = SUSE::Connect::YaST.announce_system(settings, 
distro_target)
       log.info "Global SCC credentials (username): #{login}"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-registration-4.2.7/src/lib/registration/sw_mgmt.rb 
new/yast2-registration-4.2.8/src/lib/registration/sw_mgmt.rb
--- old/yast2-registration-4.2.7/src/lib/registration/sw_mgmt.rb        
2019-08-22 17:18:15.000000000 +0200
+++ new/yast2-registration-4.2.8/src/lib/registration/sw_mgmt.rb        
2019-09-20 14:20:27.000000000 +0200
@@ -33,6 +33,8 @@
 require "registration/repo_state"
 
 require "packager/product_patterns"
+require "y2packager/medium_type"
+require "y2packager/product_control_product"
 require "y2packager/product_reader"
 require "yast2/execute"
 
@@ -147,12 +149,29 @@
       product_info
     end
 
+    # Product to register for the online installation medium
+    # @return [Hash] The product Hash
+    def self.online_base_product
+      prod = Y2Packager::ProductControlProduct.selected
+      raise "No base product selected from control.xml!" unless prod
+
+      {
+        "name"            => prod.name,
+        "version_version" => prod.version,
+        "arch"            => prod.arch,
+        "display_name"    => prod.label,
+        "register_target" => prod.register_target
+      }
+    end
+
     def self.find_base_product
       # FIXME: refactor the code to use Y2Packager::Product
 
       # just for debugging:
       return FAKE_BASE_PRODUCT if ENV["FAKE_BASE_PRODUCT"]
 
+      return online_base_product if Y2Packager::MediumType.online?
+
       # use the selected product if a product has been already selected
       selected = product_selected? if Stage.initial
       installed = product_installed? if Stage.initial
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-registration-4.2.7/src/lib/registration/ui/base_system_registration_dialog.rb
 
new/yast2-registration-4.2.8/src/lib/registration/ui/base_system_registration_dialog.rb
--- 
old/yast2-registration-4.2.7/src/lib/registration/ui/base_system_registration_dialog.rb
     2019-08-22 17:18:15.000000000 +0200
+++ 
new/yast2-registration-4.2.8/src/lib/registration/ui/base_system_registration_dialog.rb
     2019-09-20 14:20:27.000000000 +0200
@@ -11,6 +11,7 @@
 require "registration/helpers"
 require "registration/url_helpers"
 require "registration/ui/abort_confirmation"
+require "y2packager/medium_type"
 
 module Registration
   module UI
@@ -32,6 +33,7 @@
       Yast.import "Popup"
       Yast.import "Report"
       Yast.import "ProductFeatures"
+      Yast.import "Stage"
 
       WIDGETS = {
         register_scc:      [:email, :reg_code],
@@ -444,6 +446,10 @@
       def register_system_and_base_product
         registration_ui = RegistrationUI.new(registration)
 
+        # ensure the GPG keys from inst-sys are imported to the package 
manager,
+        # on the online installation medium the package manager is initialized 
later
+        Yast::Packages.ImportGPGKeys if Yast::Stage.initial && 
Y2Packager::MediumType.online?
+
         success, product_service = 
registration_ui.register_system_and_base_product
 
         if product_service && !registration_ui.install_updates?
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-registration-4.2.7/src/lib/registration/widgets/registration_code.rb 
new/yast2-registration-4.2.8/src/lib/registration/widgets/registration_code.rb
--- 
old/yast2-registration-4.2.7/src/lib/registration/widgets/registration_code.rb  
    2019-08-22 17:18:15.000000000 +0200
+++ 
new/yast2-registration-4.2.8/src/lib/registration/widgets/registration_code.rb  
    2019-09-20 14:20:27.000000000 +0200
@@ -35,6 +35,7 @@
       end
 
       def label
+        # TRANSLATORS: input field label
         _("Registration Code or RMT Server URL")
       end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-registration-4.2.7/test/base_system_registration_dialog_test.rb 
new/yast2-registration-4.2.8/test/base_system_registration_dialog_test.rb
--- old/yast2-registration-4.2.7/test/base_system_registration_dialog_test.rb   
2019-08-22 17:18:15.000000000 +0200
+++ new/yast2-registration-4.2.8/test/base_system_registration_dialog_test.rb   
2019-09-20 14:20:27.000000000 +0200
@@ -10,6 +10,10 @@
   let(:custom_url) { "http://smt.example.com/"; }
   let(:default_url) { SUSE::Connect::Config.new.url }
 
+  before do
+    allow(Yast::Packages).to receive(:ImportGPGKeys)
+  end
+
   describe ".run" do
     let(:instance) { double("dialog") }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-registration-4.2.7/test/inst_scc_test.rb 
new/yast2-registration-4.2.8/test/inst_scc_test.rb
--- old/yast2-registration-4.2.7/test/inst_scc_test.rb  2019-08-22 
17:18:15.000000000 +0200
+++ new/yast2-registration-4.2.8/test/inst_scc_test.rb  2019-09-20 
14:20:27.000000000 +0200
@@ -16,6 +16,7 @@
     allow(Yast::UI).to receive(:ReplaceWidget)
     allow(Yast::Mode).to receive(:update).and_return(false)
     allow(Yast::SlpService).to receive(:all).and_return([])
+    allow(Y2Packager::MediumType).to receive(:online?).and_return(false)
   end
 
   context "the system is already registered" do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-registration-4.2.7/test/sw_mgmt_spec.rb 
new/yast2-registration-4.2.8/test/sw_mgmt_spec.rb
--- old/yast2-registration-4.2.7/test/sw_mgmt_spec.rb   2019-08-22 
17:18:15.000000000 +0200
+++ new/yast2-registration-4.2.8/test/sw_mgmt_spec.rb   2019-09-20 
14:20:27.000000000 +0200
@@ -435,6 +435,7 @@
         .and_return("SLES"     => "skelcd-control-SLES",
                     "SLED"     => "skelcd-control-SLED",
                     "SLES_SAP" => "skelcd-control-SLES_SAP")
+      allow(Y2Packager::MediumType).to receive(:online?).and_return(false)
     end
 
     context "in installed system" do
@@ -484,6 +485,38 @@
         expect(subject.find_base_product).to eq(products3[1])
       end
     end
+
+    context "on the online installation medium" do
+      before do
+        allow(Yast::Stage).to receive(:initial).and_return(true)
+        allow(Y2Packager::MediumType).to receive(:online?).and_return(true)
+      end
+
+      it "reads the base product from control.xml" do
+        data =
+          {
+            "arch"            => "x86_64",
+            "display_name"    => "SUSE Linux Enterprise Server 15 SP2",
+            "name"            => "SLES",
+            "register_target" => "sle-15-x86_64",
+            "version_version" => "15.2"
+          }
+
+        selected = Y2Packager::ProductControlProduct.new(
+          arch:            data["arch"],
+          label:           data["display_name"],
+          license_url:     "",
+          name:            data["name"],
+          register_target: data["register_target"],
+          version:         data["version_version"]
+        )
+
+        expect(Y2Packager::ProductControlProduct).to receive(:selected)
+          .and_return(selected)
+
+        expect(subject.find_base_product).to eq(data)
+      end
+    end
   end
 
   describe ".remove_service" do


Reply via email to