Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package yast2-network for openSUSE:Factory 
checked in at 2023-01-24 19:42:40
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-network (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-network.new.32243 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-network"

Tue Jan 24 19:42:40 2023 rev:492 rq:1060667 version:4.5.14

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-network/yast2-network.changes      
2023-01-20 17:38:06.820333214 +0100
+++ /work/SRC/openSUSE:Factory/.yast2-network.new.32243/yast2-network.changes   
2023-01-24 20:37:31.077993303 +0100
@@ -1,0 +2,15 @@
+Tue Jan 24 09:37:43 UTC 2023 - Knut Anderssen <kanders...@suse.com>
+
+- Fix the return of packages needed by the selected backend when
+  running an autoinstallation (bsc#1207221)
+- 4.5.14
+
+-------------------------------------------------------------------
+Mon Jan 23 13:13:36 UTC 2023 - Knut Anderssen <kanders...@suse.com>
+
+- Fixed dirname evaluation when creating the directory for the
+  configuration files to be copied to the target system
+  (bsc#1206723, bsc#1207382)
+- 4.5.13
+
+-------------------------------------------------------------------

Old:
----
  yast2-network-4.5.12.tar.bz2

New:
----
  yast2-network-4.5.14.tar.bz2

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

Other differences:
------------------
++++++ yast2-network.spec ++++++
--- /var/tmp/diff_new_pack.n3eh1f/_old  2023-01-24 20:37:31.769996904 +0100
+++ /var/tmp/diff_new_pack.n3eh1f/_new  2023-01-24 20:37:31.773996925 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-network
-Version:        4.5.12
+Version:        4.5.14
 Release:        0
 Summary:        YaST2 - Network Configuration
 License:        GPL-2.0-only

++++++ yast2-network-4.5.12.tar.bz2 -> yast2-network-4.5.14.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-4.5.12/package/yast2-network.changes 
new/yast2-network-4.5.14/package/yast2-network.changes
--- old/yast2-network-4.5.12/package/yast2-network.changes      2023-01-19 
11:50:57.000000000 +0100
+++ new/yast2-network-4.5.14/package/yast2-network.changes      2023-01-24 
16:12:51.000000000 +0100
@@ -1,4 +1,19 @@
 -------------------------------------------------------------------
+Tue Jan 24 09:37:43 UTC 2023 - Knut Anderssen <kanders...@suse.com>
+
+- Fix the return of packages needed by the selected backend when
+  running an autoinstallation (bsc#1207221)
+- 4.5.14
+
+-------------------------------------------------------------------
+Mon Jan 23 13:13:36 UTC 2023 - Knut Anderssen <kanders...@suse.com>
+
+- Fixed dirname evaluation when creating the directory for the
+  configuration files to be copied to the target system
+  (bsc#1206723, bsc#1207382)
+- 4.5.13
+
+-------------------------------------------------------------------
 Thu Jan 12 11:45:25 UTC 2023 - Knut Anderssen <kanders...@suse.com>
 
 - Copy only the specific backend configuration to the target system
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-4.5.12/package/yast2-network.spec 
new/yast2-network-4.5.14/package/yast2-network.spec
--- old/yast2-network-4.5.12/package/yast2-network.spec 2023-01-19 
11:50:57.000000000 +0100
+++ new/yast2-network-4.5.14/package/yast2-network.spec 2023-01-24 
16:12:51.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-network
-Version:        4.5.12
+Version:        4.5.14
 Release:        0
 Summary:        YaST2 - Network Configuration
 License:        GPL-2.0-only
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-network-4.5.12/src/lib/y2network/autoinst/config.rb 
new/yast2-network-4.5.14/src/lib/y2network/autoinst/config.rb
--- old/yast2-network-4.5.12/src/lib/y2network/autoinst/config.rb       
2023-01-19 11:50:57.000000000 +0100
+++ new/yast2-network-4.5.14/src/lib/y2network/autoinst/config.rb       
2023-01-24 16:12:51.000000000 +0100
@@ -49,6 +49,8 @@
       # @option opts [Boolean] :keep_install_network
       # @option opts [Integer] :ip_check_timetout
       # @option opts [Boolean] :virt_bridge_proposal
+      # @option opts [Boolean] :managed
+      # @option opts [String, Symbol] :backend
       def initialize(opts = {})
         ay_options = opts.reject { |_k, v| v.nil? }
 
@@ -58,7 +60,7 @@
         @ip_check_timeout = ay_options.fetch(:ip_check_timeout, -1)
         @virt_bridge_proposal = ay_options.fetch(:virt_bridge_proposal, true)
         @managed              = ay_options[:managed]
-        @backend              = ay_options[:backend]
+        @backend              = ay_options[:backend]&.to_sym
       end
 
       # Return whether the network should be copied at the end
@@ -67,6 +69,16 @@
       def copy_network?
         keep_install_network || before_proposal
       end
+
+      # Explicitly selected backend according to the AY options given
+      #
+      # @return [Symbol, nil]
+      def selected_backend
+        return backend.to_sym unless [nil, ""].include?(backend)
+        return if managed.nil?
+
+        managed ? :network_manager : :wicked
+      end
     end
   end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-4.5.12/src/lib/y2network/helpers.rb 
new/yast2-network-4.5.14/src/lib/y2network/helpers.rb
--- old/yast2-network-4.5.12/src/lib/y2network/helpers.rb       2023-01-19 
11:50:57.000000000 +0100
+++ new/yast2-network-4.5.14/src/lib/y2network/helpers.rb       2023-01-24 
16:12:51.000000000 +0100
@@ -46,10 +46,11 @@
       glob_files = ::Dir.glob(files)
       return false if glob_files.empty?
 
-      log.info("Copying '#{glob_files.join(",")}' to '#{dest_path}'.")
+      dest_dir = include ? dest_path : ::File.dirname(dest_path)
+      log.info("Copying '#{glob_files.join(",")}' to '#{dest_dir}'.")
 
-      ::FileUtils.mkdir_p(include ? dest_path : dest_path.dirname)
-      ::FileUtils.cp(glob_files, dest_path, preserve: true)
+      ::FileUtils.mkdir_p(dest_dir)
+      ::FileUtils.cp(glob_files, dest_dir, preserve: true)
       true
     end
   end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-network-4.5.12/src/lib/y2network/proposal_settings.rb 
new/yast2-network-4.5.14/src/lib/y2network/proposal_settings.rb
--- old/yast2-network-4.5.12/src/lib/y2network/proposal_settings.rb     
2023-01-19 11:50:57.000000000 +0100
+++ new/yast2-network-4.5.14/src/lib/y2network/proposal_settings.rb     
2023-01-24 16:12:51.000000000 +0100
@@ -237,12 +237,7 @@
     end
 
     def autoinst_backend
-      auto_config = Yast::Lan.autoinst
-
-      return auto_config.backend.to_sym unless [nil, 
""].include?(auto_config.backend)
-      return if auto_config.managed.nil?
-
-      auto_config.managed ? :network_manager : :wicked
+      Yast::Lan.autoinst.selected_backend
     end
 
     # Convenience method to check whether the bridge configuration proposal for
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-4.5.12/src/modules/Lan.rb 
new/yast2-network-4.5.14/src/modules/Lan.rb
--- old/yast2-network-4.5.12/src/modules/Lan.rb 2023-01-19 11:50:57.000000000 
+0100
+++ new/yast2-network-4.5.14/src/modules/Lan.rb 2023-01-24 16:12:51.000000000 
+0100
@@ -41,6 +41,7 @@
 require "y2network/interface_config_builder"
 require "y2network/presenters/summary"
 require "y2network/interface_type"
+require "y2network/proposal_settings"
 require "y2issues"
 
 require "shellwords"
@@ -651,27 +652,32 @@
     #
     # @return [Array] of packages needed when writing the config
     def Packages
-      pkgs = []
-      backend = yast_config&.backend
-
-      return pkgs unless backend
+      backend = if Mode.autoinst
+        Y2Network::Backend.all.find { |b| b.id == 
proposal_settings.current_backend }
+      else
+        yast_config&.backend
+      end
+      return [] unless backend
 
-      backend.packages.each { |p| pkgs << p if !Package.Installed(p) }
+      target = Mode.autoinst ? :autoinst : :system
+      needed_packages = backend.packages.reject { |p| Package.Installed(p, 
target: target) }
 
-      if (backend.id == :wicked) && !Package.Installed("wpa_supplicant")
+      if (backend.id == :wicked) && !Package.Installed("wpa_supplicant", 
target: target)
         # we have to add wpa_supplicant when wlan is in game, wicked relies on 
it
         wlan_present = yast_config.interfaces.any? do |iface|
           iface.type == Y2Network::InterfaceType::WIRELESS
         end
 
-        pkgs << "wpa_supplicant" if wlan_present
+        needed_packages << "wpa_supplicant" if wlan_present
       end
 
-      pkgs.uniq!
+      needed_packages.uniq!
 
-      log.info("Additional packages requested by yast2-network: 
#{pkgs.inspect}") if !pkgs.empty?
+      unless needed_packages.empty?
+        log.info("Additional packages requested by yast2-network: 
#{needed_packages.inspect}")
+      end
 
-      pkgs
+      needed_packages
     end
 
     # @return [Array] of packages needed when writing the config in autoinst
@@ -843,6 +849,10 @@
       Y2Network::Autoinst::Config.new(ay_settings)
     end
 
+    def proposal_settings
+      Y2Network::ProposalSettings.instance
+    end
+
     def autoinst_settings(section)
       {
         before_proposal:      section.setup_before_proposal,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-network-4.5.12/test/data/instsys/etc/sysctl.d/70-yast.conf 
new/yast2-network-4.5.14/test/data/instsys/etc/sysctl.d/70-yast.conf
--- old/yast2-network-4.5.12/test/data/instsys/etc/sysctl.d/70-yast.conf        
1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-network-4.5.14/test/data/instsys/etc/sysctl.d/70-yast.conf        
2023-01-24 16:12:51.000000000 +0100
@@ -0,0 +1,3 @@
+net.ipv4.ip_forward = 1
+net.ipv6.conf.all.forwarding = 0
+net.ipv6.conf.all.disable_ipv6 = 1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-4.5.12/test/lan_test.rb 
new/yast2-network-4.5.14/test/lan_test.rb
--- old/yast2-network-4.5.12/test/lan_test.rb   2023-01-19 11:50:57.000000000 
+0100
+++ new/yast2-network-4.5.14/test/lan_test.rb   2023-01-24 16:12:51.000000000 
+0100
@@ -37,6 +37,7 @@
   let(:system_config) { Y2Network::Config.new(interfaces: [], source: :wicked) 
}
   let(:backend_id) { :wicked }
   let(:backend) { Y2Network::Backend.by_id(backend_id) }
+  let(:autoinst) { false }
 
   describe "#Packages" do
     let(:backend_installed) { false }
@@ -49,6 +50,8 @@
 
     before(:each) do
       Yast::Lan.add_config(:yast, yast_config)
+      Yast::Lan.autoinst.backend = backend_id
+      allow(Yast::Mode).to receive(:autoinst).and_return(autoinst)
       allow(Yast::Package).to receive(:Installed).and_return(backend_installed)
     end
 
@@ -77,7 +80,7 @@
         it "proposes wpa_supplicant to be installed" do
           allow(Yast::Package)
             .to receive(:Installed)
-            .with("wpa_supplicant")
+            .with("wpa_supplicant", target: :system)
             .and_return(false)
 
           expect(Yast::Lan.Packages).to include "wpa_supplicant"
@@ -94,6 +97,24 @@
         end
       end
     end
+
+    context "when running in autoinstallation" do
+      let(:autoinst) { true }
+
+      before do
+        Yast::Lan.autoinst.backend = :network_manager
+        Y2Network::ProposalSettings.create_instance
+      end
+
+      it "checks the AutoYaST selected backend" do
+        expect(Yast::Package).to receive(:Installed).with("NetworkManager", 
target: :autoinst)
+        Yast::Lan.Packages
+      end
+
+      it "lists the package needed by the installation if not in the 
Resolvables" do
+        expect(Yast::Lan.Packages).to include "NetworkManager"
+      end
+    end
   end
 
   describe "#activate_network_service" do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-network-4.5.12/test/save_network_test.rb 
new/yast2-network-4.5.14/test/save_network_test.rb
--- old/yast2-network-4.5.12/test/save_network_test.rb  2023-01-19 
11:50:57.000000000 +0100
+++ new/yast2-network-4.5.14/test/save_network_test.rb  2023-01-24 
16:12:51.000000000 +0100
@@ -75,6 +75,11 @@
       FileUtils.remove_entry(destdir) if Dir.exist?(destdir)
     end
 
+    it "copies /etc/sysctl.d/70-yast.conf config when it exists" do
+      subject.main
+      expect(File).to exist(File.join(destdir, "etc", "sysctl.d", 
"70-yast.conf"))
+    end
+
     it "copies /etc/hostname and /etc/hosts when exist" do
       subject.main
       expect(File).to_not exist(File.join(destdir, "etc", "hosts"))

Reply via email to