Hello community,

here is the log from the commit of package autoyast2 for openSUSE:Factory 
checked in at 2020-08-14 13:10:17
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/autoyast2 (Old)
 and      /work/SRC/openSUSE:Factory/.autoyast2.new.3399 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "autoyast2"

Fri Aug 14 13:10:17 2020 rev:286 rq:826198 version:4.3.35

Changes:
--------
--- /work/SRC/openSUSE:Factory/autoyast2/autoyast2.changes      2020-08-01 
12:32:00.206503178 +0200
+++ /work/SRC/openSUSE:Factory/.autoyast2.new.3399/autoyast2.changes    
2020-08-14 13:10:20.617233386 +0200
@@ -1,0 +2,24 @@
+Thu Aug 13 07:04:06 UTC 2020 - Michal Filka <[email protected]>
+
+- bsc#1173624
+  - Run firewall configuration in first stage
+- 4.3.35
+
+-------------------------------------------------------------------
+Tue Aug 11 10:13:57 CEST 2020 - [email protected]
+
+- AutoYaST: Added supplements: autoyast(files,general,report,scripts,
+  partitioning,software) into the spec file in order to install
+  this packages if the section has been defined in the AY
+  configuration file (bsc#1146494).
+- 4.3.34
+
+-------------------------------------------------------------------
+Tue Aug  4 16:31:17 CEST 2020 - [email protected]
+
+- Improve finding the respective package for a section in the XML
+  installation profile. Find a package with the
+  "autoyast(<section_name>)" supplements dependency (bsc#1146494).
+- 4.3.33
+
+-------------------------------------------------------------------

Old:
----
  autoyast2-4.3.32.tar.bz2

New:
----
  autoyast2-4.3.35.tar.bz2

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

Other differences:
------------------
++++++ autoyast2.spec ++++++
--- /var/tmp/diff_new_pack.oHw0sB/_old  2020-08-14 13:10:21.189233604 +0200
+++ /var/tmp/diff_new_pack.oHw0sB/_new  2020-08-14 13:10:21.193233605 +0200
@@ -22,7 +22,7 @@
 %endif
 
 Name:           autoyast2
-Version:        4.3.32
+Version:        4.3.35
 Release:        0
 Summary:        YaST2 - Automated Installation
 License:        GPL-2.0-only
@@ -137,6 +137,8 @@
 Provides:       yast2-trans-autoinst
 Obsoletes:      yast2-trans-autoinst
 
+Supplements:    autoyast(files,general,report,scripts,partitioning,software)
+
 %description installation
 This package performs auto-installation relying on a control file
 generated with the autoyast2 package.

++++++ autoyast2-4.3.32.tar.bz2 -> autoyast2-4.3.35.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autoyast2-4.3.32/package/autoyast2.changes 
new/autoyast2-4.3.35/package/autoyast2.changes
--- old/autoyast2-4.3.32/package/autoyast2.changes      2020-07-31 
10:35:35.000000000 +0200
+++ new/autoyast2-4.3.35/package/autoyast2.changes      2020-08-13 
09:52:00.000000000 +0200
@@ -1,4 +1,28 @@
 -------------------------------------------------------------------
+Thu Aug 13 07:04:06 UTC 2020 - Michal Filka <[email protected]>
+
+- bsc#1173624
+  - Run firewall configuration in first stage
+- 4.3.35
+
+-------------------------------------------------------------------
+Tue Aug 11 10:13:57 CEST 2020 - [email protected]
+
+- AutoYaST: Added supplements: autoyast(files,general,report,scripts,
+  partitioning,software) into the spec file in order to install
+  this packages if the section has been defined in the AY
+  configuration file (bsc#1146494).
+- 4.3.34
+
+-------------------------------------------------------------------
+Tue Aug  4 16:31:17 CEST 2020 - [email protected]
+
+- Improve finding the respective package for a section in the XML
+  installation profile. Find a package with the
+  "autoyast(<section_name>)" supplements dependency (bsc#1146494).
+- 4.3.33
+
+-------------------------------------------------------------------
 Thu Jul 30 14:00:17 UTC 2020 - Knut Anderssen <[email protected]>
 
 - Do not report profile validation errors multiple times if the
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autoyast2-4.3.32/package/autoyast2.spec 
new/autoyast2-4.3.35/package/autoyast2.spec
--- old/autoyast2-4.3.32/package/autoyast2.spec 2020-07-31 10:35:35.000000000 
+0200
+++ new/autoyast2-4.3.35/package/autoyast2.spec 2020-08-13 09:52:00.000000000 
+0200
@@ -22,7 +22,7 @@
 %endif
 
 Name:           autoyast2
-Version:        4.3.32
+Version:        4.3.35
 Release:        0
 Summary:        YaST2 - Automated Installation
 License:        GPL-2.0-only
@@ -137,6 +137,8 @@
 Provides:       yast2-trans-autoinst
 Obsoletes:      yast2-trans-autoinst
 
+Supplements:    autoyast(files,general,report,scripts,partitioning,software)
+
 %description installation
 This package performs auto-installation relying on a control file
 generated with the autoyast2 package.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autoyast2-4.3.32/src/clients/inst_autoconfigure.rb 
new/autoyast2-4.3.35/src/clients/inst_autoconfigure.rb
--- old/autoyast2-4.3.32/src/clients/inst_autoconfigure.rb      2020-07-31 
10:35:35.000000000 +0200
+++ new/autoyast2-4.3.35/src/clients/inst_autoconfigure.rb      2020-08-13 
09:52:00.000000000 +0200
@@ -85,7 +85,9 @@
       unknown_sections = importer.unhandled_sections - unsupported_sections
       if unknown_sections.any?
         log.error "Could not process these unknown profile sections: 
#{unknown_sections}"
-        needed_packages = 
Y2Autoinstallation::PackagerSearcher.new(unknown_sections).evaluate
+        needed_packages = Y2Autoinstallation::PackagerSearcher.new(
+          unknown_sections
+        ).evaluate_via_schema
         schema_package_list = if needed_packages.empty?
           unknown_sections.map { |section| "&lt;#{section}/&gt;" }
         else
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/autoyast2-4.3.32/src/lib/autoinstall/autosetup_helpers.rb 
new/autoyast2-4.3.35/src/lib/autoinstall/autosetup_helpers.rb
--- old/autoyast2-4.3.32/src/lib/autoinstall/autosetup_helpers.rb       
2020-07-31 10:35:35.000000000 +0200
+++ new/autoyast2-4.3.35/src/lib/autoinstall/autosetup_helpers.rb       
2020-08-13 09:52:00.000000000 +0200
@@ -197,8 +197,44 @@
       Y2Autoinstallation::XmlChecks.instance
     end
 
+    # Invokes autoyast setup for firewall
+    def autosetup_firewall
+      return if !Yast::Profile.current["firewall"]
+
+      # in some cases we need to postpone firewall configuration to the second 
stage
+      # we also have to guarantee that firewall is not blocking second stage 
in this case
+      firewall_section = if need_second_stage_run?
+        { "enable_firewall" => false }
+      else
+        Yast::Profile.current["firewall"]
+      end
+
+      log.info("Importing Firewall settings from AY profile")
+      Yast::WFM.CallFunction("firewall_auto", ["Import", firewall_section])
+
+      Yast::Profile.remove_sections("firewall") if !need_second_stage_run?
+    end
+
   private
 
+    # Checks whether we need to run second stage handling
+    def need_second_stage_run?
+      Yast.import "Linuxrc"
+
+      profile = Yast::Profile.current
+
+      # We have a problem when
+      # 1) running remote installation
+      # 2) second stage was requested
+      # 3) firewall was configured (somehow) and started via AY profile we can 
expect that
+      # ssh / vnc port can be blocked.
+      remote_installer = Yast::Linuxrc.usessh || Yast::Linuxrc.vnc
+      second_stage_required = profile.dig("general", "mode", "second_stage")
+      firewall_enabled = profile.dig("firewall", "enable_firewall")
+
+      remote_installer && second_stage_required && firewall_enabled
+    end
+
     def utf8_supported?
       (Yast::UI.GetDisplayInfo || {}).fetch("HasFullUtf8Support", true)
     end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/autoyast2-4.3.32/src/lib/autoinstall/clients/inst_autosetup.rb 
new/autoyast2-4.3.35/src/lib/autoinstall/clients/inst_autosetup.rb
--- old/autoyast2-4.3.32/src/lib/autoinstall/clients/inst_autosetup.rb  
2020-07-31 10:35:35.000000000 +0200
+++ new/autoyast2-4.3.35/src/lib/autoinstall/clients/inst_autosetup.rb  
2020-08-13 09:52:00.000000000 +0200
@@ -365,6 +365,11 @@
           end
         end
 
+        #
+        # Run firewall configuration according to the profile
+        #
+        autosetup_firewall
+
         # Results of imported values semantic check.
         return :abort unless AutoInstall.valid_imported_values
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/autoyast2-4.3.32/src/lib/autoinstall/package_searcher.rb 
new/autoyast2-4.3.35/src/lib/autoinstall/package_searcher.rb
--- old/autoyast2-4.3.32/src/lib/autoinstall/package_searcher.rb        
2020-07-31 10:35:35.000000000 +0200
+++ new/autoyast2-4.3.35/src/lib/autoinstall/package_searcher.rb        
2020-08-13 09:52:00.000000000 +0200
@@ -18,6 +18,7 @@
 # find current contact information at www.suse.com.
 
 require "yast"
+require "y2packager/resolvable"
 
 Yast.import "PackageSystem"
 
@@ -31,12 +32,44 @@
       @sections = sections
     end
 
-    # Gets packages that needs to be installed
+    # Gets packages that needs to be installed via RPM supplements.
+    # @return [Hash<String, Array<String>>] Required packages of a section.
+    def evaluate_via_rpm
+      package_names = {}
+      log.info "Evaluating needed packages for handling AY-sections via RPM 
Supplements"
+      log.info "Sections: #{sections}"
+      packages = Y2Packager::Resolvable.find(kind: :package)
+
+      sections.each do |section|
+        # Evaluting which package has the supplement autoyast(<section>)
+        package_names[section] = []
+        packages.each do |p|
+          p.deps.each do |dep|
+            next if !dep["supplements"] ||
+              !dep["supplements"].match(/^autoyast\((.*)\)/)
+
+            suppl_sections = Regexp.last_match(1).split(",")
+            suppl_sections.each do |sup_section|
+              next unless sup_section == section
+
+              log.info("Package #{p.name} supports section #{section}" \
+                       " via supplement.")
+              package_names[section] << p.name
+            end
+          end
+        end
+      end
+
+      package_names
+    end
+
+    # Gets packages that needs to be installed via the schema file
     # @return [Hash<String, Array<String>>] Required packages of a section. 
Return only
     #   packages that are not already installed.
-    def evaluate
+    def evaluate_via_schema
       package_names = {}
-      log.info "Evaluating needed packages for handling AY-sections 
#{sections}"
+      log.info "Evaluating needed packages via schema for handling AY-sections 
via schema entries."
+      log.info "Sections: #{sections}"
 
       if !File.exist?(SCHEMA_PACKAGE_FILE)
         log.error "Cannot evaluate due to missing yast2-schema"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autoyast2-4.3.32/src/modules/AutoinstSoftware.rb 
new/autoyast2-4.3.35/src/modules/AutoinstSoftware.rb
--- old/autoyast2-4.3.32/src/modules/AutoinstSoftware.rb        2020-07-31 
10:35:35.000000000 +0200
+++ new/autoyast2-4.3.35/src/modules/AutoinstSoftware.rb        2020-08-13 
09:52:00.000000000 +0200
@@ -164,6 +164,20 @@
     def AddYdepsFromProfile(entries)
       Builtins.y2milestone("AddYdepsFromProfile entries %1", entries)
       pkglist = []
+      # Evaluating packages via RPM supplements ( e.g. autoyast(kdump) )
+      req_packages = 
Y2Autoinstallation::PackagerSearcher.new(entries).evaluate_via_rpm
+      entries.reject! do |e|
+        packs = req_packages[e]
+        if packs.empty?
+          false
+        else
+          log.info "AddYdepsFromProfile add packages #{packs} for entry #{e}"
+          pkglist += packs
+          true
+        end
+      end
+
+      # Evaluating packages for not founded entries via desktop file and rnc 
files.
       entries.each do |e|
         registry = Y2Autoinstallation::Entries::Registry.instance
         description = registry.descriptions.find { |d| 
d.managed_keys.include?(e) }
@@ -188,7 +202,7 @@
 
         packages = Pkg.PkgQueryProvides(provide)
         if packages.empty?
-          packs = Y2Autoinstallation::PackagerSearcher.new([e]).evaluate[e]
+          packs = 
Y2Autoinstallation::PackagerSearcher.new([e]).evaluate_via_schema[e]
           if packs.nil? || packs.empty?
             log.info "No package provides: #{provide}"
           else
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autoyast2-4.3.32/test/lib/autosetup_helpers_test.rb 
new/autoyast2-4.3.35/test/lib/autosetup_helpers_test.rb
--- old/autoyast2-4.3.32/test/lib/autosetup_helpers_test.rb     2020-07-31 
10:35:35.000000000 +0200
+++ new/autoyast2-4.3.35/test/lib/autosetup_helpers_test.rb     2020-08-13 
09:52:00.000000000 +0200
@@ -242,6 +242,47 @@
 
   end
 
+  describe "#autosetup_firewall" do
+    let(:profile) { { "firewall" => firewall_section } }
+    let(:firewall_section) { { "default_zone" => "external" } }
+
+    before(:each) do
+      Yast::Profile.current = profile
+      Yast::AutoinstConfig.main
+
+      allow(Yast::WFM).to receive(:CallFunction).with("firewall_auto", 
anything)
+    end
+
+    context "when a firewall section is present in the profile" do
+      context "when no second stage run is needed" do
+        before(:each) do
+          allow(client).to receive(:need_second_stage_run?).and_return(false)
+        end
+
+        it "removes the firewall section from the profile" do
+          client.autosetup_firewall
+          expect(Yast::Profile.current.keys).to_not include("firewall")
+        end
+      end
+
+      context "when second stage run is needed" do
+        before(:each) do
+          allow(client).to receive(:need_second_stage_run?).and_return(true)
+        end
+
+        it "does not remove the firewall section from the profile" do
+          client.autosetup_firewall
+          expect(Yast::Profile.current.keys).to include("firewall")
+        end
+
+        it "does not corrupt the profile" do
+          client.autosetup_firewall
+          expect(Yast::Profile.current).to eql profile
+        end
+      end
+    end
+  end
+
   describe "#autosetup_network" do
     let(:profile) { networking_section }
     let(:networking_section) { { "networking" => { "setup_before_proposal" => 
true } } }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/autoyast2-4.3.32/test/lib/clients/inst_autosetup_test.rb 
new/autoyast2-4.3.35/test/lib/clients/inst_autosetup_test.rb
--- old/autoyast2-4.3.32/test/lib/clients/inst_autosetup_test.rb        
2020-07-31 10:35:35.000000000 +0200
+++ new/autoyast2-4.3.35/test/lib/clients/inst_autosetup_test.rb        
2020-08-13 09:52:00.000000000 +0200
@@ -81,6 +81,11 @@
       subject.main
     end
 
+    it "sets up the firewall configuration" do
+      expect(subject).to receive(:autosetup_firewall)
+      subject.main
+    end
+
     it "sets up the partitioning schema" do
       expect(Yast::AutoinstStorage).to receive(:Import).and_return(true)
       expect(Yast::AutoinstStorage).to receive(:Write).and_return(true)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autoyast2-4.3.32/test/lib/package_searcher_test.rb 
new/autoyast2-4.3.35/test/lib/package_searcher_test.rb
--- old/autoyast2-4.3.32/test/lib/package_searcher_test.rb      2020-07-31 
10:35:35.000000000 +0200
+++ new/autoyast2-4.3.35/test/lib/package_searcher_test.rb      2020-08-13 
09:52:00.000000000 +0200
@@ -30,7 +30,7 @@
                                                     ])
   end
 
-  describe "#evaluate" do
+  describe "#evaluate_via_schema" do
     context "no package belongs to section" do
       let(:sections) { ["nis"] }
       it "returns hash with section and empty array" do
@@ -40,7 +40,7 @@
           "stderr" => ""
         )
 
-        expect(subject.evaluate).to eq("nis" => [])
+        expect(subject.evaluate_via_schema).to eq("nis" => [])
       end
     end
 
@@ -55,7 +55,7 @@
 
         allow(Yast::PackageSystem).to receive(:Installed).and_return(true)
 
-        expect(subject.evaluate).to eq("add-on" => [])
+        expect(subject.evaluate_via_schema).to eq("add-on" => [])
       end
     end
 
@@ -70,7 +70,42 @@
 
         allow(Yast::PackageSystem).to receive(:Installed).and_return(false)
 
-        expect(subject.evaluate).to eq("audit-laf" => ["yast2-audit-laf"])
+        expect(subject.evaluate_via_schema).to eq("audit-laf" => 
["yast2-audit-laf"])
+      end
+    end
+  end
+
+  describe "#evaluate_via_rpm" do
+    let(:packages) do
+      [
+        Y2Packager::Resolvable.new("kind" => :package,
+           "name" => "foo", "source" => 1,
+           "version" => "1.0", "arch" => "x86_64", "status" => :selected,
+           "deps" => [{ "provides" => "foo" }]),
+        Y2Packager::Resolvable.new("kind" => :package,
+           "name" => "yast2-users", "source" => 1,
+           "version" => "1.0", "arch" => "x86_64", "status" => :selected,
+           "deps" => [{ "supplements" => "autoyast(groups,users)" }])
+      ]
+    end
+
+    before do
+      allow(Y2Packager::Resolvable).to receive(:find).with(
+        kind: :package
+      ).and_return(packages)
+    end
+
+    context "no package belongs to section" do
+      let(:sections) { ["nis"] }
+      it "returns hash with section and [] value" do
+        expect(subject.evaluate_via_rpm).to eq("nis" => [])
+      end
+    end
+
+    context "package belonging to section" do
+      let(:sections) { ["users"] }
+      it "returns hash with section and array with package" do
+        expect(subject.evaluate_via_rpm).to eq("users" => ["yast2-users"])
       end
     end
   end


Reply via email to