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-12-03 10:03:13
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/autoyast2 (Old)
 and      /work/SRC/openSUSE:Factory/.autoyast2.new.1835 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "autoyast2"

Sat Dec  3 10:03:13 2022 rev:330 rq:1039522 version:4.5.11

Changes:
--------
--- /work/SRC/openSUSE:Factory/autoyast2/autoyast2.changes      2022-11-18 
15:43:15.706490560 +0100
+++ /work/SRC/openSUSE:Factory/.autoyast2.new.1835/autoyast2.changes    
2022-12-03 10:03:16.499119759 +0100
@@ -1,0 +2,13 @@
+Thu Dec  1 09:36:51 UTC 2022 - Imobach Gonzalez Sosa <igonzalezs...@suse.com>
+
+- Avoid a potential crash when autoinst.ycp file is empty or
+  missing (bsc#1205732).
+- 4.5.11
+
+-------------------------------------------------------------------
+Tue Nov 22 15:50:38 UTC 2022 - Martin Vidner <mvid...@suse.com>
+
+- Fix hash vs keyword arguments in RSpec expectations (bsc#1204871)
+- 4.5.10
+
+-------------------------------------------------------------------

Old:
----
  autoyast2-4.5.9.tar.bz2

New:
----
  autoyast2-4.5.11.tar.bz2

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

Other differences:
------------------
++++++ autoyast2.spec ++++++
--- /var/tmp/diff_new_pack.KNUwWk/_old  2022-12-03 10:03:17.083123003 +0100
+++ /var/tmp/diff_new_pack.KNUwWk/_new  2022-12-03 10:03:17.087123026 +0100
@@ -22,7 +22,7 @@
 %endif
 
 Name:           autoyast2
-Version:        4.5.9
+Version:        4.5.11
 Release:        0
 Summary:        YaST2 - Automated Installation
 License:        GPL-2.0-only

++++++ autoyast2-4.5.9.tar.bz2 -> autoyast2-4.5.11.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autoyast2-4.5.9/package/autoyast2.changes 
new/autoyast2-4.5.11/package/autoyast2.changes
--- old/autoyast2-4.5.9/package/autoyast2.changes       2022-11-17 
06:44:50.000000000 +0100
+++ new/autoyast2-4.5.11/package/autoyast2.changes      2022-12-01 
12:46:53.000000000 +0100
@@ -1,4 +1,17 @@
 -------------------------------------------------------------------
+Thu Dec  1 09:36:51 UTC 2022 - Imobach Gonzalez Sosa <igonzalezs...@suse.com>
+
+- Avoid a potential crash when autoinst.ycp file is empty or
+  missing (bsc#1205732).
+- 4.5.11
+
+-------------------------------------------------------------------
+Tue Nov 22 15:50:38 UTC 2022 - Martin Vidner <mvid...@suse.com>
+
+- Fix hash vs keyword arguments in RSpec expectations (bsc#1204871)
+- 4.5.10
+
+-------------------------------------------------------------------
 Tue Nov  8 15:52:04 UTC 2022 - Josef Reidinger <jreidin...@suse.com>
 
 - Add needed packages for kdump even when kdump section is not
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autoyast2-4.5.9/package/autoyast2.spec 
new/autoyast2-4.5.11/package/autoyast2.spec
--- old/autoyast2-4.5.9/package/autoyast2.spec  2022-11-17 06:44:50.000000000 
+0100
+++ new/autoyast2-4.5.11/package/autoyast2.spec 2022-12-01 12:46:53.000000000 
+0100
@@ -22,7 +22,7 @@
 %endif
 
 Name:           autoyast2
-Version:        4.5.9
+Version:        4.5.11
 Release:        0
 Summary:        YaST2 - Automated Installation
 License:        GPL-2.0-only
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autoyast2-4.5.9/src/modules/Profile.rb 
new/autoyast2-4.5.11/src/modules/Profile.rb
--- old/autoyast2-4.5.9/src/modules/Profile.rb  2022-11-17 06:44:50.000000000 
+0100
+++ new/autoyast2-4.5.11/src/modules/Profile.rb 2022-12-01 12:46:53.000000000 
+0100
@@ -113,7 +113,7 @@
       Yast.include self, "autoinstall/xml.rb"
 
       # The Complete current Profile
-      @current = {}
+      @current = Yast::ProfileHash.new
 
       @changed = false
 
@@ -352,7 +352,7 @@
     # @return [void]
     def Reset
       Builtins.y2milestone("Resetting profile contents")
-      @current = {}
+      @current = Yast::ProfileHash.new
       nil
     end
 
@@ -430,18 +430,19 @@
     end
 
     # Read YCP data as the control file
-    # @param parsedControlFile [Hash] ycp file
-    # @return [Boolean]
+    # @param parsedControlFile [String] path of the ycp file
+    # @return [Boolean] false when the file is empty or missing; true otherwise
     def ReadProfileStructure(parsedControlFile)
-      @current = Convert.convert(
+      contents = Convert.convert(
         SCR.Read(path(".target.ycp"), [parsedControlFile, {}]),
         from: "any",
         to:   "map <string, any>"
       )
-      if @current == {}
+      if contents == {}
+        @current = Yast::ProfileHash.new(contents)
         return false
       else
-        Import(@current)
+        Import(contents)
       end
 
       true
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autoyast2-4.5.9/test/AutoInstallRules_test.rb 
new/autoyast2-4.5.11/test/AutoInstallRules_test.rb
--- old/autoyast2-4.5.9/test/AutoInstallRules_test.rb   2022-11-17 
06:44:50.000000000 +0100
+++ new/autoyast2-4.5.11/test/AutoInstallRules_test.rb  2022-12-01 
12:46:53.000000000 +0100
@@ -124,6 +124,8 @@
   end
 
   describe "#Read" do
+    let(:env) { { "hostaddress" => subject.hostaddress, "mac" => subject.mac } 
}
+
     it "Reading rules with -or- operator" do
       expect(Yast::XML).to receive(:XMLToYCPFile).and_return(
         "rules" => [{
@@ -138,7 +140,7 @@
       expect(Yast::SCR).to 
receive(:Execute).with(Yast::Path.new(".target.bash_output"),
         "if  ( [ \"$hostaddress\" = \"10.69.57.43\" ] )   ||   " \
           "( [ \"$mac\" = \"000c2903d288\" ] ); then exit 0; else exit 1; fi",
-        "hostaddress" => subject.hostaddress, "mac" => subject.mac)
+        env)
         .and_return("stdout" => "", "exit" => 0, "stderr" => "")
 
       subject.Read
@@ -158,7 +160,7 @@
       expect(Yast::SCR).to 
receive(:Execute).with(Yast::Path.new(".target.bash_output"),
         "if  ( [ \"$hostaddress\" = \"10.69.57.43\" ] )   &&   " \
           "( [ \"$mac\" = \"000c2903d288\" ] ); then exit 0; else exit 1; fi",
-        "hostaddress" => subject.hostaddress, "mac" => subject.mac)
+        env)
         .and_return("stdout" => "", "exit" => 0, "stderr" => "")
 
       subject.Read
@@ -177,7 +179,7 @@
       expect(Yast::SCR).to 
receive(:Execute).with(Yast::Path.new(".target.bash_output"),
         "if  ( [ \"$hostaddress\" = \"10.69.57.43\" ] )   &&   " \
           "( [ \"$mac\" = \"000c2903d288\" ] ); then exit 0; else exit 1; fi",
-        "hostaddress" => subject.hostaddress, "mac" => subject.mac)
+        env)
         .and_return("stdout" => "", "exit" => 0, "stderr" => "")
 
       subject.Read
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autoyast2-4.5.9/test/fixtures/autoconf.ycp 
new/autoyast2-4.5.11/test/fixtures/autoconf.ycp
--- old/autoyast2-4.5.9/test/fixtures/autoconf.ycp      1970-01-01 
01:00:00.000000000 +0100
+++ new/autoyast2-4.5.11/test/fixtures/autoconf.ycp     2022-12-01 
12:46:53.000000000 +0100
@@ -0,0 +1,7 @@
+$[
+  "general" : $[
+    "mode" : $[
+      "confirm" : false
+    ]
+  ]
+]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autoyast2-4.5.9/test/fixtures/empty-autoconf.ycp 
new/autoyast2-4.5.11/test/fixtures/empty-autoconf.ycp
--- old/autoyast2-4.5.9/test/fixtures/empty-autoconf.ycp        1970-01-01 
01:00:00.000000000 +0100
+++ new/autoyast2-4.5.11/test/fixtures/empty-autoconf.ycp       2022-12-01 
12:46:53.000000000 +0100
@@ -0,0 +1,2 @@
+$[
+]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autoyast2-4.5.9/test/lib/autosetup_helpers_test.rb 
new/autoyast2-4.5.11/test/lib/autosetup_helpers_test.rb
--- old/autoyast2-4.5.9/test/lib/autosetup_helpers_test.rb      2022-11-17 
06:44:50.000000000 +0100
+++ new/autoyast2-4.5.11/test/lib/autosetup_helpers_test.rb     2022-12-01 
12:46:53.000000000 +0100
@@ -451,6 +451,8 @@
       Yast::Profile.current = profile
       allow(Yast::Installation).to receive(:encoding=)
       allow(Yast::Profile).to receive(:remove_sections)
+      allow(Yast::UI).to receive(:SetLanguage)
+      allow(Yast::WFM).to receive(:SetLanguage)
     end
 
     it "sets the language config based on the profile" do
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autoyast2-4.5.9/test/lib/clients/ayast_setup_test.rb 
new/autoyast2-4.5.11/test/lib/clients/ayast_setup_test.rb
--- old/autoyast2-4.5.9/test/lib/clients/ayast_setup_test.rb    2022-11-17 
06:44:50.000000000 +0100
+++ new/autoyast2-4.5.11/test/lib/clients/ayast_setup_test.rb   2022-12-01 
12:46:53.000000000 +0100
@@ -125,9 +125,8 @@
     end
 
     it "imports general settings" do
-      expect(Yast::AutoinstGeneral).to receive(:Import).with(
-        "mode" => { "confirm" => true }
-      )
+      settings = { "mode" => { "confirm" => true } }
+      expect(Yast::AutoinstGeneral).to receive(:Import).with(settings)
       subject.Setup
     end
   end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/autoyast2-4.5.9/test/profile_test.rb 
new/autoyast2-4.5.11/test/profile_test.rb
--- old/autoyast2-4.5.9/test/profile_test.rb    2022-11-17 06:44:50.000000000 
+0100
+++ new/autoyast2-4.5.11/test/profile_test.rb   2022-12-01 12:46:53.000000000 
+0100
@@ -734,4 +734,50 @@
       end
     end
   end
+
+  describe "#ReadProfileStructure" do
+    context "when the file does not exist" do
+      let(:file_path) { FIXTURES_PATH.join("missing.ycp").to_s }
+
+      it "returns false" do
+        expect(subject.ReadProfileStructure(file_path)).to eq(false)
+      end
+
+      it "resets Profile.current" do
+        subject.Import("general" => { "self_update" => false })
+        subject.ReadProfileStructure(file_path)
+        expect(subject.current).to eq(Yast::ProfileHash.new)
+      end
+    end
+
+    context "when the structure is empty" do
+      let(:file_path) { FIXTURES_PATH.join("empty-autoconf.ycp").to_s }
+
+      it "returns false" do
+        expect(subject.ReadProfileStructure(file_path)).to eq(false)
+      end
+
+      it "resets Profile.current" do
+        subject.Import("general" => { "self_update" => false })
+        subject.ReadProfileStructure(file_path)
+        expect(subject.current).to eq(Yast::ProfileHash.new)
+      end
+    end
+
+    context "when there is some valid YCP content" do
+      let(:file_path) { FIXTURES_PATH.join("autoconf.ycp").to_s }
+
+      it "returns true" do
+        expect(subject.ReadProfileStructure(file_path)).to eq(true)
+      end
+
+      it "imports the file contents" do
+        subject.Import("general" => { "self_update" => false })
+        expect(subject).to receive(:Import).with(
+          Yast::ProfileHash.new("general" => { "mode" => { "confirm" => false 
} })
+        )
+        subject.ReadProfileStructure(file_path)
+      end
+    end
+  end
 end

Reply via email to