Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package autoyast2 for openSUSE:Factory 
checked in at 2021-07-29 21:31:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/autoyast2 (Old)
 and      /work/SRC/openSUSE:Factory/.autoyast2.new.1899 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "autoyast2"

Thu Jul 29 21:31:02 2021 rev:305 rq:908355 version:4.4.15

Changes:
--------
--- /work/SRC/openSUSE:Factory/autoyast2/autoyast2.changes      2021-07-21 
19:07:26.087401462 +0200
+++ /work/SRC/openSUSE:Factory/.autoyast2.new.1899/autoyast2.changes    
2021-07-29 21:31:28.468807234 +0200
@@ -1,0 +2,14 @@
+Tue Jul 20 14:45:51 UTC 2021 - Ladislav Slez??k <lsle...@suse.cz>
+
+- Fixed handling of the "final_reboot" and "final_halt" options,
+  add the custom scripts only once and avoid displaying
+  a warning popup during installation (bsc#1188356)
+- 4.4.15
+
+-------------------------------------------------------------------
+Fri Jul 16 15:27:30 UTC 2021 - Imobach Gonzalez Sosa <igonzalezs...@suse.com>
+
+- Copy the init-scripts to the right location during 1st stage
+  (bsc#1188360).
+
+-------------------------------------------------------------------

Old:
----
  autoyast2-4.4.14.tar.bz2

New:
----
  autoyast2-4.4.15.tar.bz2

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

Other differences:
------------------
++++++ autoyast2.spec ++++++
--- /var/tmp/diff_new_pack.cLHZkh/_old  2021-07-29 21:31:29.172806367 +0200
+++ /var/tmp/diff_new_pack.cLHZkh/_new  2021-07-29 21:31:29.176806362 +0200
@@ -22,7 +22,7 @@
 %endif
 
 Name:           autoyast2
-Version:        4.4.14
+Version:        4.4.15
 Release:        0
 Summary:        YaST2 - Automated Installation
 License:        GPL-2.0-only
@@ -44,7 +44,6 @@
 # GPG symmetric methods and Password dialog
 BuildRequires:  yast2 >= 4.3.25
 # FileSystems.read_default_subvol_from_target
-BuildRequires:  yast2-xml
 BuildRequires:  yast2-country
 BuildRequires:  yast2-network >= 3.1.145
 BuildRequires:  yast2-packager
@@ -52,6 +51,7 @@
 BuildRequires:  yast2-slp
 BuildRequires:  yast2-transfer
 BuildRequires:  yast2-update >= 3.3.0
+BuildRequires:  yast2-xml
 # Required for test suite testing one time sync
 BuildRequires:  yast2-ntp-client >= 4.0.1
 # New API for Y2Storage::PackageHandler and storage features
@@ -78,8 +78,8 @@
 Requires:       yast2-transfer >= 2.21.0
 Requires:       yast2-xml
 # New API for Y2Storage::PackageHandler and storage features
-Requires:       yast2-storage-ng >= 4.2.95
 Requires:       yast2-ruby-bindings >= 1.0.0
+Requires:       yast2-storage-ng >= 4.2.95
 
 Conflicts:      yast2-installation < 3.1.166
 

++++++ autoyast2-4.4.14.tar.bz2 -> autoyast2-4.4.15.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autoyast2-4.4.14/package/autoyast2.changes 
new/autoyast2-4.4.15/package/autoyast2.changes
--- old/autoyast2-4.4.14/package/autoyast2.changes      2021-07-19 
11:38:58.000000000 +0200
+++ new/autoyast2-4.4.15/package/autoyast2.changes      2021-07-26 
09:49:34.000000000 +0200
@@ -1,4 +1,18 @@
 -------------------------------------------------------------------
+Tue Jul 20 14:45:51 UTC 2021 - Ladislav Slez??k <lsle...@suse.cz>
+
+- Fixed handling of the "final_reboot" and "final_halt" options,
+  add the custom scripts only once and avoid displaying
+  a warning popup during installation (bsc#1188356)
+- 4.4.15
+
+-------------------------------------------------------------------
+Fri Jul 16 15:27:30 UTC 2021 - Imobach Gonzalez Sosa <igonzalezs...@suse.com>
+
+- Copy the init-scripts to the right location during 1st stage
+  (bsc#1188360).
+
+-------------------------------------------------------------------
 Fri Jul 16 11:20:20 UTC 2021 - Imobach Gonzalez Sosa <igonzalezs...@suse.com>
 
 - Copy the files to the right location when a <file_location>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autoyast2-4.4.14/package/autoyast2.spec 
new/autoyast2-4.4.15/package/autoyast2.spec
--- old/autoyast2-4.4.14/package/autoyast2.spec 2021-07-19 11:38:58.000000000 
+0200
+++ new/autoyast2-4.4.15/package/autoyast2.spec 2021-07-26 09:49:34.000000000 
+0200
@@ -22,7 +22,7 @@
 %endif
 
 Name:           autoyast2
-Version:        4.4.14
+Version:        4.4.15
 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.14/src/lib/autoinstall/script.rb 
new/autoyast2-4.4.15/src/lib/autoinstall/script.rb
--- old/autoyast2-4.4.14/src/lib/autoinstall/script.rb  2021-07-19 
11:38:58.000000000 +0200
+++ new/autoyast2-4.4.15/src/lib/autoinstall/script.rb  2021-07-26 
09:49:34.000000000 +0200
@@ -418,6 +418,15 @@
     def script_path
       File.join(Yast::AutoinstConfig.initscripts_dir, script_name)
     end
+
+    # Returns the path to write the script
+    #
+    # The init-scripts always run in the target system.
+    #
+    # @return [String] Path to write the script
+    def localfile
+      File.join(Yast::AutoinstConfig.destdir, super)
+    end
   end
 
   # Scripts that are used when processing the <ask-list> section
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autoyast2-4.4.14/src/modules/Profile.rb 
new/autoyast2-4.4.15/src/modules/Profile.rb
--- old/autoyast2-4.4.14/src/modules/Profile.rb 2021-07-19 11:38:58.000000000 
+0200
+++ new/autoyast2-4.4.15/src/modules/Profile.rb 2021-07-26 09:49:34.000000000 
+0200
@@ -196,11 +196,9 @@
             Builtins.remove(Ops.get_map(@current, "general", {}), "clock")
           )
         end
-        if Ops.get_boolean(@current, ["general", "mode", "final_halt"], false)
-          script = {
-            "filename" => "zzz_halt",
-            "source"   => "shutdown -h now"
-          }
+        if Ops.get_boolean(@current, ["general", "mode", "final_halt"], false) 
&&
+            !Ops.get_list(@current, ["scripts", "init-scripts"], 
[]).include?(HALT_SCRIPT)
+
           Ops.set(@current, "scripts", {}) if !Builtins.haskey(@current, 
"scripts")
           if !Builtins.haskey(
             Ops.get_map(@current, "scripts", {}),
@@ -213,15 +211,13 @@
             ["scripts", "init-scripts"],
             Builtins.add(
               Ops.get_list(@current, ["scripts", "init-scripts"], []),
-              script
+              HALT_SCRIPT
             )
           )
         end
-        if Ops.get_boolean(@current, ["general", "mode", "final_reboot"], 
false)
-          script = {
-            "filename" => "zzz_reboot",
-            "source"   => "shutdown -r now"
-          }
+        if Ops.get_boolean(@current, ["general", "mode", "final_reboot"], 
false) &&
+            !Ops.get_list(@current, ["scripts", "init-scripts"], 
[]).include?(REBOOT_SCRIPT)
+
           Ops.set(@current, "scripts", {}) if !Builtins.haskey(@current, 
"scripts")
           if !Builtins.haskey(
             Ops.get_map(@current, "scripts", {}),
@@ -234,7 +230,7 @@
             ["scripts", "init-scripts"],
             Builtins.add(
               Ops.get_list(@current, ["scripts", "init-scripts"], []),
-              script
+              REBOOT_SCRIPT
             )
           )
         end
@@ -725,6 +721,16 @@
 
   private
 
+    REBOOT_SCRIPT = {
+      "filename" => "zzz_reboot",
+      "source"   => "shutdown -r now"
+    }.freeze
+
+    HALT_SCRIPT = {
+      "filename" => "zzz_halt",
+      "source"   => "shutdown -h now"
+    }.freeze
+
     def add_autoyast_packages
       @current["software"]["packages"] = 
@current["software"].fetch_as_array("packages")
       @current["software"]["packages"] << needed_second_stage_packages
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autoyast2-4.4.14/test/lib/script_test.rb 
new/autoyast2-4.4.15/test/lib/script_test.rb
--- old/autoyast2-4.4.14/test/lib/script_test.rb        2021-07-19 
11:38:58.000000000 +0200
+++ new/autoyast2-4.4.15/test/lib/script_test.rb        2021-07-26 
09:49:34.000000000 +0200
@@ -381,6 +381,16 @@
       expect(subject.script_path).to eq "/var/adm/autoinstall/init.d/test.sh"
     end
   end
+
+  describe "#localfile" do
+    before do
+      allow(Yast::AutoinstConfig).to receive(:destdir).and_return("/mnt")
+    end
+
+    it "returns the path in the target system" do
+      expect(subject.localfile).to eq "/mnt/var/adm/autoinstall/init.d/test.sh"
+    end
+  end
 end
 
 describe Y2Autoinstallation::AskScript do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autoyast2-4.4.14/test/profile_test.rb 
new/autoyast2-4.4.15/test/profile_test.rb
--- old/autoyast2-4.4.14/test/profile_test.rb   2021-07-19 11:38:58.000000000 
+0200
+++ new/autoyast2-4.4.15/test/profile_test.rb   2021-07-26 09:49:34.000000000 
+0200
@@ -28,6 +28,12 @@
     items_list("patterns")
   end
 
+  def reboot_scripts
+    Yast::Profile.current["scripts"]["init-scripts"].select do |s|
+      s["filename"] == "zzz_reboot"
+    end
+  end
+
   describe "#softwareCompat" do
     before do
       Yast::Profile.current = profile
@@ -123,6 +129,37 @@
       end
     end
   end
+
+  describe "#generalCompat" do
+    before do
+      Yast::Profile.current = profile
+    end
+
+    context "when a custom reboot script is not present" do
+      let(:profile) { { "general" => { "mode" => { "final_reboot" => true } } 
} }
+
+      it "adds a reboot script for the 'final_reboot' flag" do
+        Yast::Profile.generalCompat
+        expect(reboot_scripts).to_not be_empty
+      end
+    end
+
+    # the first stage adds a custom script for the "final_reboot" flag,
+    # ensure the second stage does not add it again (bsc#1188356)
+    context "when a custom reboot script is present" do
+      let(:profile) do
+        { "general" => { "mode" => { "final_reboot" => true } },
+          "scripts" => { "init-scripts" => [
+            { "filename" => "zzz_reboot", "source" => "shutdown -r now" }
+          ] } }
+      end
+
+      it "does not duplicate the reboot script" do
+        Yast::Profile.generalCompat
+        expect(reboot_scripts.size).to eq(1)
+      end
+    end
+  end
 
   describe "#Import" do
     let(:profile) { Yast::ProfileHash.new }

Reply via email to