Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package autoyast2 for openSUSE:Factory 
checked in at 2022-01-22 08:17:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/autoyast2 (Old)
 and      /work/SRC/openSUSE:Factory/.autoyast2.new.1938 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "autoyast2"

Sat Jan 22 08:17:58 2022 rev:313 rq:947695 version:4.4.26

Changes:
--------
--- /work/SRC/openSUSE:Factory/autoyast2/autoyast2.changes      2022-01-15 
21:45:24.961620959 +0100
+++ /work/SRC/openSUSE:Factory/.autoyast2.new.1938/autoyast2.changes    
2022-01-22 08:18:16.578866498 +0100
@@ -1,0 +2,7 @@
+Thu Jan 20 07:58:35 UTC 2022 - Imobach Gonzalez Sosa <igonzalezs...@suse.com>
+
+- Fix handling of add-on signature settings, introduced when fixing
+  bsc#1192437 (bsc#1194881).
+- 4.4.26
+
+-------------------------------------------------------------------

Old:
----
  autoyast2-4.4.25.tar.bz2

New:
----
  autoyast2-4.4.26.tar.bz2

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

Other differences:
------------------
++++++ autoyast2.spec ++++++
--- /var/tmp/diff_new_pack.V1Ke05/_old  2022-01-22 08:18:17.330861430 +0100
+++ /var/tmp/diff_new_pack.V1Ke05/_new  2022-01-22 08:18:17.334861403 +0100
@@ -22,7 +22,7 @@
 %endif
 
 Name:           autoyast2
-Version:        4.4.25
+Version:        4.4.26
 Release:        0
 Summary:        YaST2 - Automated Installation
 License:        GPL-2.0-only

++++++ autoyast2-4.4.25.tar.bz2 -> autoyast2-4.4.26.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autoyast2-4.4.25/package/autoyast2.changes 
new/autoyast2-4.4.26/package/autoyast2.changes
--- old/autoyast2-4.4.25/package/autoyast2.changes      2022-01-14 
16:05:02.000000000 +0100
+++ new/autoyast2-4.4.26/package/autoyast2.changes      2022-01-20 
14:00:25.000000000 +0100
@@ -1,4 +1,11 @@
 -------------------------------------------------------------------
+Thu Jan 20 07:58:35 UTC 2022 - Imobach Gonzalez Sosa <igonzalezs...@suse.com>
+
+- Fix handling of add-on signature settings, introduced when fixing
+  bsc#1192437 (bsc#1194881).
+- 4.4.26
+
+-------------------------------------------------------------------
 Thu Jan 13 11:58:37 UTC 2022 - Imobach Gonzalez Sosa <igonzalezs...@suse.com>
 
 - Properly merge the autoupgrade workflow when using the online
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autoyast2-4.4.25/package/autoyast2.spec 
new/autoyast2-4.4.26/package/autoyast2.spec
--- old/autoyast2-4.4.25/package/autoyast2.spec 2022-01-14 16:05:02.000000000 
+0100
+++ new/autoyast2-4.4.26/package/autoyast2.spec 2022-01-20 14:00:25.000000000 
+0100
@@ -22,7 +22,7 @@
 %endif
 
 Name:           autoyast2
-Version:        4.4.25
+Version:        4.4.26
 Release:        0
 Summary:        YaST2 - Automated Installation
 License:        GPL-2.0-only
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/autoyast2-4.4.25/src/lib/autoinstall/pkg_gpg_check_handler.rb 
new/autoyast2-4.4.26/src/lib/autoinstall/pkg_gpg_check_handler.rb
--- old/autoyast2-4.4.25/src/lib/autoinstall/pkg_gpg_check_handler.rb   
2022-01-14 16:05:02.000000000 +0100
+++ new/autoyast2-4.4.26/src/lib/autoinstall/pkg_gpg_check_handler.rb   
2022-01-20 14:00:25.000000000 +0100
@@ -31,12 +31,13 @@
     # @option data [String] "Localpath" Path to RPM file.
     # @option data [String] "RepoMediaUrl" Media URL.
     #   (it should match `media_url` key in AutoYaST profile).
-    # @param [Hash] profile AutoYaST profile.
-    def initialize(data, profile)
+    # @param signature_handling [Hash] Signature handling settings (from 
AutoYaST general section)
+    # @param addons [Array<Hash>] Defined add-ons to check for signature 
settings
+    def initialize(data, signature_handling = {}, addons = [])
       @result  = data["CheckPackageResult"]
       @package = data["Package"]
       @path    = data["Localpath"]
-      @config  = get_addon_config(profile, data["RepoMediaUrl"])
+      @config  = get_addon_config(signature_handling, addons, 
data["RepoMediaUrl"])
       log.info format("Signature handling settings: #{@config}")
     end
 
@@ -143,27 +144,13 @@
     # If the add-on has its own specific configuration, those settings
     # will override to general settings.
     #
-    # @param [Yast::ProfileHash] profile AutoYaST profile
+    # @param signature_handling [Hash] General signature handling options
+    # @param addons [Array<Hash>] List of add-ons
     # @param [String] url   Repository URL
-    # @return [Yast::ProfileHash] Signature handling settings for the given 
add-on.
-    def get_addon_config(profile, url)
-      config = addons_config(profile).find { |c| c["media_url"] == url }
-      addon_config = Yast::ProfileHash.new(config || {})
-
-      general_config = profile.fetch_as_hash("general")
-      general_config.fetch_as_hash("signature-handling")
-        .merge(addon_config.fetch_as_hash("signature-handling"))
-    end
-
-    # Get add-ons configuration
-    #
-    # This is just a helper method that returns the //add-ons/add_on_products 
section
-    # of an AutoYaST profile.
-    #
-    # @param [Yast::ProfileHash] profile AutoYaST profile.
-    # @return [Array<Hash>] Add-ons section from profile.
-    def addons_config(profile)
-      profile.fetch_as_hash("add-on").fetch_as_array("add_on_products")
+    # @return [Hash] Signature handling settings for the given add-on.
+    def get_addon_config(signature_handling, addons, url)
+      addon_config = addons.find { |a| a["media_url"] == url } || {}
+      signature_handling.merge(addon_config.fetch("signature-handling", {}))
     end
 
     # Find the key ID for the package
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autoyast2-4.4.25/src/modules/AutoInstall.rb 
new/autoyast2-4.4.26/src/modules/AutoInstall.rb
--- old/autoyast2-4.4.25/src/modules/AutoInstall.rb     2022-01-14 
16:05:02.000000000 +0100
+++ new/autoyast2-4.4.26/src/modules/AutoInstall.rb     2022-01-20 
14:00:25.000000000 +0100
@@ -22,8 +22,10 @@
       Yast.import "Profile"
       Yast.import "Mode"
       Yast.import "Stage"
-      Yast.import "AutoinstConfig"
       Yast.import "AutoInstallRules"
+      Yast.import "AutoinstConfig"
+      Yast.import "AutoinstGeneral"
+      Yast.import "AddOnProduct"
       Yast.import "Report"
       Yast.import "TFTP"
 
@@ -334,7 +336,10 @@
     #   a blank string is returned (so no decision is made).
     def pkg_gpg_check(data)
       log.debug("pkgGpgCheck data: #{data}")
-      accept = PkgGpgCheckHandler.new(data, Profile.current).accept?
+      checker = PkgGpgCheckHandler.new(
+        data, Yast::AutoinstGeneral.signature_handling, 
Yast::AddOnProduct.add_on_products
+      )
+      accept = checker.accept?
       log.info("PkgGpgCheckerHandler for #{data["Package"]} returned 
#{accept}")
       accept ? "I" : ""
     end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autoyast2-4.4.25/test/AutoInstall_test.rb 
new/autoyast2-4.4.26/test/AutoInstall_test.rb
--- old/autoyast2-4.4.25/test/AutoInstall_test.rb       2022-01-14 
16:05:02.000000000 +0100
+++ new/autoyast2-4.4.26/test/AutoInstall_test.rb       2022-01-20 
14:00:25.000000000 +0100
@@ -24,12 +24,14 @@
 
   describe "#pkg_gpg_check" do
     let(:data) { { "CheckPackageResult" => Yast::PkgGpgCheckHandler::CHK_OK } }
-    let(:profile) { {} }
     let(:checker) { double("checker") }
+    let(:signature_handling) { { "accept_unsigned_file" => true } }
 
     before do
-      allow(Yast::Profile).to receive(:current).and_return(profile)
-      allow(Yast::PkgGpgCheckHandler).to receive(:new).with(data, 
profile).and_return(checker)
+      allow(Yast::AutoinstGeneral).to receive(:signature_handling)
+        .and_return(signature_handling)
+      allow(Yast::PkgGpgCheckHandler).to receive(:new)
+        .with(data, signature_handling, []).and_return(checker)
       allow(checker).to receive(:accept?).and_return(accept?)
     end
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/autoyast2-4.4.25/test/lib/pkg_gpg_check_handler_test.rb 
new/autoyast2-4.4.26/test/lib/pkg_gpg_check_handler_test.rb
--- old/autoyast2-4.4.25/test/lib/pkg_gpg_check_handler_test.rb 2022-01-14 
16:05:02.000000000 +0100
+++ new/autoyast2-4.4.26/test/lib/pkg_gpg_check_handler_test.rb 2022-01-20 
14:00:25.000000000 +0100
@@ -8,7 +8,9 @@
 Yast.import "Profile"
 
 describe Yast::PkgGpgCheckHandler do
-  subject(:handler) { Yast::PkgGpgCheckHandler.new(data, profile) }
+  subject(:handler) do
+    Yast::PkgGpgCheckHandler.new(data, signature_handling, addons)
+  end
 
   let(:data) do
     Yast::ProfileHash.new(
@@ -19,10 +21,8 @@
     )
   end
   let(:result) { Yast::PkgGpgCheckHandler::CHK_OK }
-  let(:profile) do
-    Yast::ProfileHash.new("general" => { "signature-handling" => 
signature_handling })
-  end
   let(:signature_handling) { {} }
+  let(:addons) { [] }
 
   describe "#accept?" do
     context "when signature is OK" do
@@ -212,8 +212,8 @@
         end
       end
 
+      # Using '<all>' element in profile instead of just 'true'.
       context "and all packages with non trusted keys are allowed" do
-        # Using '<all>' element in profile instead of just 'true'.
         let(:signature_handling) { { "accept_non_trusted_gpg_key" => { "all" 
=> true } } }
 
         it "returns true" do
@@ -270,24 +270,16 @@
     context "when the add-on has specific settings" do
       let(:result) { Yast::PkgGpgCheckHandler::CHK_NOTFOUND }
 
-      let(:profile) do
-        Yast::ProfileHash.new(
-          "general" => {
-            "signature-handling" => {
-              "accept_unsigned_file"   => true,
-              "accept_unknown_gpg_key" => true
-            }
-          },
-          "add-on"  => {
-            "add_on_products" => [
-              {
-                "media_url"          => 
"http://dl.opensuse.org/repos/YaST:/Head";,
-                "name"               => "yast_head",
-                "signature-handling" => { "accept_unsigned_file" => false }
-              }
-            ]
-          }
-        )
+      let(:signature_handling) do
+        { "accept_unsigned_file" => true, "accept_unknown_gpg_key" => true }
+      end
+
+      let(:addons) do
+        [
+          { "media_url"          => "http://dl.opensuse.org/repos/YaST:/Head";,
+            "name"               => "yast_head",
+            "signature-handling" => { "accept_unsigned_file" => false } }
+        ]
       end
 
       it "honors the add-on settings" do
@@ -296,7 +288,9 @@
 
       it "honors general settings which are not overridden" do
         gpg_handler = Yast::PkgGpgCheckHandler.new(
-          data.merge("CheckPackageResult" => 
Yast::PkgGpgCheckHandler::CHK_NOKEY), profile
+          data.merge("CheckPackageResult" => 
Yast::PkgGpgCheckHandler::CHK_NOKEY),
+          signature_handling,
+          addons
         )
         expect(gpg_handler.accept?).to eq(true)
       end

Reply via email to