Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package yast2 for openSUSE:Factory checked 
in at 2025-03-16 18:57:55
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2 (Old)
 and      /work/SRC/openSUSE:Factory/.yast2.new.19136 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2"

Sun Mar 16 18:57:55 2025 rev:563 rq:1252686 version:5.0.13

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2/yast2.changes      2025-02-21 
21:35:12.001321594 +0100
+++ /work/SRC/openSUSE:Factory/.yast2.new.19136/yast2.changes   2025-03-16 
18:58:03.627148685 +0100
@@ -1,0 +2,6 @@
+Wed Mar 12 11:48:52 UTC 2025 - Stefan Schubert <sch...@suse.de>
+
+- Checking if a TPM2 device is available (has_tpm2). (jsc#PED-10703)
+- 5.0.13
+
+-------------------------------------------------------------------

Old:
----
  yast2-5.0.12.tar.bz2

New:
----
  yast2-5.0.13.tar.bz2

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

Other differences:
------------------
++++++ yast2.spec ++++++
--- /var/tmp/diff_new_pack.sgR5mY/_old  2025-03-16 18:58:04.211173116 +0100
+++ /var/tmp/diff_new_pack.sgR5mY/_new  2025-03-16 18:58:04.215173284 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2
-Version:        5.0.12
+Version:        5.0.13
 
 Release:        0
 Summary:        YaST2 Main Package

++++++ yast2-5.0.12.tar.bz2 -> yast2-5.0.13.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-5.0.12/library/general/src/modules/Arch.rb 
new/yast2-5.0.13/library/general/src/modules/Arch.rb
--- old/yast2-5.0.12/library/general/src/modules/Arch.rb        2025-02-20 
17:40:41.000000000 +0100
+++ new/yast2-5.0.13/library/general/src/modules/Arch.rb        2025-03-13 
09:54:49.000000000 +0100
@@ -45,6 +45,8 @@
 
       @_has_pcmcia = nil
 
+      @_has_tpm2 = nil
+
       @_is_laptop = nil
 
       @_is_uml = nil
@@ -427,6 +429,14 @@
       SCR.Read(path(".target.string"), "/sys/hypervisor/guest_type").strip == 
"PV"
     end
 
+    # Whether a TPM2 chip is available or not.
+    #
+    # @return [Boolean] true if a TPM2 chip is available; false otherwise
+    def has_tpm2
+      @_has_tpm2 = SCR.Read(path(".target.string"), 
"/sys/module/tpm/version")&.strip == "2.0" if @_has_tpm2.nil?
+      @_has_tpm2
+    end
+
     # Convenience method to retrieve the /proc/xen/capabilities content
     #
     # @return [String]
@@ -577,6 +587,7 @@
     publish function: :board_pegasos, type: "boolean ()"
     publish function: :board_wintel, type: "boolean ()"
     publish function: :has_pcmcia, type: "boolean ()"
+    publish function: :has_tpm2, type: "boolean ()"
     publish function: :is_laptop, type: "boolean ()"
     publish function: :is_uml, type: "boolean ()"
     publish function: :is_xen, type: "boolean ()"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-5.0.12/library/general/test/arch_test.rb 
new/yast2-5.0.13/library/general/test/arch_test.rb
--- old/yast2-5.0.12/library/general/test/arch_test.rb  2025-02-20 
17:40:41.000000000 +0100
+++ new/yast2-5.0.13/library/general/test/arch_test.rb  2025-03-13 
09:54:49.000000000 +0100
@@ -319,4 +319,33 @@
       end
     end
   end
+
+  describe ".has_tpm2" do
+    it "returns true if /sys/module/tpm/version is set correctly" do
+      allow(Yast::SCR).to receive(:Read)
+        .with(Yast::Path.new(".target.string"), 
"/sys/module/tpm/version").and_return("2.0")
+
+      has_tpm2 = Yast::Arch.has_tpm2
+
+      expect(has_tpm2).to eq(true)
+    end
+
+    it "returns false if /sys/module/tpm/version has wrong version" do
+      allow(Yast::SCR).to receive(:Read)
+        .with(Yast::Path.new(".target.string"), 
"/sys/module/tpm/version").and_return("1.0")
+
+      has_tpm2 = Yast::Arch.has_tpm2
+
+      expect(has_tpm2).to eq(false)
+    end
+
+    it "returns false if /sys/module/tpm/version does not exist" do
+      allow(Yast::SCR).to receive(:Read)
+        .with(Yast::Path.new(".target.string"), 
"/sys/module/tpm/version").and_return(nil)
+
+      has_tpm2 = Yast::Arch.has_tpm2
+
+      expect(has_tpm2).to eq(false)
+    end
+  end
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-5.0.12/package/yast2.changes 
new/yast2-5.0.13/package/yast2.changes
--- old/yast2-5.0.12/package/yast2.changes      2025-02-20 17:40:41.000000000 
+0100
+++ new/yast2-5.0.13/package/yast2.changes      2025-03-13 09:54:49.000000000 
+0100
@@ -1,4 +1,10 @@
 -------------------------------------------------------------------
+Wed Mar 12 11:48:52 UTC 2025 - Stefan Schubert <sch...@suse.de>
+
+- Checking if a TPM2 device is available (has_tpm2). (jsc#PED-10703)
+- 5.0.13
+
+-------------------------------------------------------------------
 Thu Feb 20 16:09:57 UTC 2025 - Josef Reidinger <jreidin...@suse.com>
 
 - respect kernel parameter filtering from agama if found
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-5.0.12/package/yast2.spec 
new/yast2-5.0.13/package/yast2.spec
--- old/yast2-5.0.12/package/yast2.spec 2025-02-20 17:40:41.000000000 +0100
+++ new/yast2-5.0.13/package/yast2.spec 2025-03-13 09:54:49.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2
-Version:        5.0.12
+Version:        5.0.13
 
 Release:        0
 Summary:        YaST2 Main Package

Reply via email to