Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package yast2-storage-ng for 
openSUSE:Factory checked in at 2024-02-20 21:12:27
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-storage-ng (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-storage-ng.new.1706 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-storage-ng"

Tue Feb 20 21:12:27 2024 rev:151 rq:1147376 version:5.0.6

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-storage-ng/yast2-storage-ng.changes        
2024-02-15 20:58:41.992354617 +0100
+++ 
/work/SRC/openSUSE:Factory/.yast2-storage-ng.new.1706/yast2-storage-ng.changes  
    2024-02-20 21:12:31.049850489 +0100
@@ -1,0 +2,8 @@
+Wed Feb 14 09:11:06 UTC 2024 - Michal Filka <mfi...@suse.com>
+
+- jsc#PED-6407
+  - new env variable YAST_REUSE_LVM for reusing LVM in new
+    installation. It can be used as linuxrc boot param.
+- 5.0.6
+
+-------------------------------------------------------------------

Old:
----
  yast2-storage-ng-5.0.5.tar.bz2

New:
----
  yast2-storage-ng-5.0.6.tar.bz2

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

Other differences:
------------------
++++++ yast2-storage-ng.spec ++++++
--- /var/tmp/diff_new_pack.tegdNf/_old  2024-02-20 21:12:31.633871682 +0100
+++ /var/tmp/diff_new_pack.tegdNf/_new  2024-02-20 21:12:31.637871828 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-storage-ng
-Version:        5.0.5
+Version:        5.0.6
 Release:        0
 Summary:        YaST2 - Storage Configuration
 License:        GPL-2.0-only OR GPL-3.0-only

++++++ yast2-storage-ng-5.0.5.tar.bz2 -> yast2-storage-ng-5.0.6.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-5.0.5/package/yast2-storage-ng.changes 
new/yast2-storage-ng-5.0.6/package/yast2-storage-ng.changes
--- old/yast2-storage-ng-5.0.5/package/yast2-storage-ng.changes 2024-02-12 
16:57:32.000000000 +0100
+++ new/yast2-storage-ng-5.0.6/package/yast2-storage-ng.changes 2024-02-16 
10:31:44.000000000 +0100
@@ -1,4 +1,12 @@
 -------------------------------------------------------------------
+Wed Feb 14 09:11:06 UTC 2024 - Michal Filka <mfi...@suse.com>
+
+- jsc#PED-6407
+  - new env variable YAST_REUSE_LVM for reusing LVM in new
+    installation. It can be used as linuxrc boot param.
+- 5.0.6
+
+-------------------------------------------------------------------
 Mon Feb 12 15:18:51 UTC 2024 - Stefan Hundhammer <shundham...@suse.com>
 
 - Added new libstorage enum value UF_BCACHEFS to fix build failure
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-storage-ng-5.0.5/package/yast2-storage-ng.spec 
new/yast2-storage-ng-5.0.6/package/yast2-storage-ng.spec
--- old/yast2-storage-ng-5.0.5/package/yast2-storage-ng.spec    2024-02-12 
16:57:32.000000000 +0100
+++ new/yast2-storage-ng-5.0.6/package/yast2-storage-ng.spec    2024-02-16 
10:31:44.000000000 +0100
@@ -16,7 +16,7 @@
 #
 
 Name:           yast2-storage-ng
-Version:        5.0.5
+Version:        5.0.6
 Release:        0
 Summary:        YaST2 - Storage Configuration
 License:        GPL-2.0-only OR GPL-3.0-only
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-5.0.5/src/lib/y2storage/proposal/lvm_helper.rb 
new/yast2-storage-ng-5.0.6/src/lib/y2storage/proposal/lvm_helper.rb
--- old/yast2-storage-ng-5.0.5/src/lib/y2storage/proposal/lvm_helper.rb 
2024-02-12 16:57:32.000000000 +0100
+++ new/yast2-storage-ng-5.0.6/src/lib/y2storage/proposal/lvm_helper.rb 
2024-02-16 10:31:44.000000000 +0100
@@ -166,8 +166,6 @@
       # @return [Boolean]
       def try_to_reuse?
         # Setting introduced to completely avoid LVM reusing in D-Installer.
-        # It's a new playground, so no need to carry YaST behaviors that have
-        # proven to be confusing.
         return false if settings.lvm_vg_reuse == false
 
         # We introduced this when we still didn't have a mechanism to activate
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-5.0.5/src/lib/y2storage/proposal_settings.rb 
new/yast2-storage-ng-5.0.6/src/lib/y2storage/proposal_settings.rb
--- old/yast2-storage-ng-5.0.5/src/lib/y2storage/proposal_settings.rb   
2024-02-12 16:57:32.000000000 +0100
+++ new/yast2-storage-ng-5.0.6/src/lib/y2storage/proposal_settings.rb   
2024-02-16 10:31:44.000000000 +0100
@@ -29,6 +29,7 @@
 require "y2storage/encryption_method"
 require "y2storage/equal_by_instance_variables"
 require "y2storage/proposal_space_settings"
+require "y2storage/storage_env"
 
 module Y2Storage
   # Class to manage settings used by the proposal (typically read from 
control.xml)
@@ -245,6 +246,7 @@
     def for_current_product
       apply_defaults
       load_features
+      apply_user_enforced
     end
 
     # Produces a deep copy of settings
@@ -411,6 +413,14 @@
       end
     end
 
+    # Some values can be explicitly enforced by user
+    # This setting should have precendence over everything else
+    def apply_user_enforced
+      value = StorageEnv.instance.requested_lvm_reuse
+
+      send(:lvm_vg_reuse=, StorageEnv.instance.requested_lvm_reuse) if 
!value.nil?
+    end
+
     # Overrides the settings with values read from the YaST product features
     # (i.e. values in /control.xml).
     #
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-5.0.5/src/lib/y2storage/storage_env.rb 
new/yast2-storage-ng-5.0.6/src/lib/y2storage/storage_env.rb
--- old/yast2-storage-ng-5.0.5/src/lib/y2storage/storage_env.rb 2024-02-12 
16:57:32.000000000 +0100
+++ new/yast2-storage-ng-5.0.6/src/lib/y2storage/storage_env.rb 2024-02-16 
10:31:44.000000000 +0100
@@ -36,8 +36,11 @@
 
     ENV_LIBSTORAGE_IGNORE_PROBE_ERRORS = 
"LIBSTORAGE_IGNORE_PROBE_ERRORS".freeze
 
+    ENV_REUSE_LVM = "YAST_REUSE_LVM".freeze
+
     private_constant :ENV_MULTIPATH, :ENV_BIOS_RAID, :ENV_ACTIVATE_LUKS, 
:ENV_LUKS2_AVAILABLE
     private_constant :ENV_LIBSTORAGE_IGNORE_PROBE_ERRORS
+    private_constant :ENV_REUSE_LVM
 
     def initialize
       reset_cache
@@ -89,6 +92,19 @@
       active?(ENV_LUKS2_AVAILABLE, default: false)
     end
 
+    # Whether YaST should reuse existing LVM
+    #
+    # see jsc#PED-6407 or jsc#IBM-1315
+    #
+    # @return [Boolean, nil] boolean as explicitly set by user, nil if user 
set nothing
+    def requested_lvm_reuse
+      value = read(ENV_REUSE_LVM)
+
+      return nil if !value
+
+      env_str_to_bool(value)
+    end
+
     # Whether errors during libstorage probing should be ignored.
     #
     # See bsc#1177332:
@@ -106,6 +122,13 @@
 
     private
 
+    # Takes a string and translates it to bool in a similar way how linuxrc 
does
+    def env_str_to_bool(value)
+      # Similar to what linuxrc does, also consider the flag activated if the
+      # variable is used with no value or with "1"
+      value.casecmp?("on") || value.empty? || value == "1"
+    end
+
     # Whether the env variable is active
     #
     # @param variable [String]
@@ -116,9 +139,7 @@
 
       value = read(variable)
       result = if value
-        # Similar to what linuxrc does, also consider the flag activated if the
-        # variable is used with no value or with "1"
-        value.casecmp?("on") || value.empty? || value == "1"
+        env_str_to_bool(value)
       else
         default
       end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-storage-ng-5.0.5/test/y2storage/storage_env_test.rb 
new/yast2-storage-ng-5.0.6/test/y2storage/storage_env_test.rb
--- old/yast2-storage-ng-5.0.5/test/y2storage/storage_env_test.rb       
2024-02-12 16:57:32.000000000 +0100
+++ new/yast2-storage-ng-5.0.6/test/y2storage/storage_env_test.rb       
2024-02-16 10:31:44.000000000 +0100
@@ -68,4 +68,36 @@
       end
     end
   end
+
+  describe "#requested_lvm_reuse" do
+    context "YAST_REUSE_LVM is set to '1'" do
+      let(:env_vars) do
+        { "YAST_REUSE_LVM" => "1" }
+      end
+
+      it "returns true" do
+        expect(Y2Storage::StorageEnv.instance.requested_lvm_reuse).to be true
+      end
+    end
+
+    context "YAST_REUSE_LVM is set to '0'" do
+      let(:env_vars) do
+        { "YAST_REUSE_LVM" => "0" }
+      end
+
+      it "returns false" do
+        expect(Y2Storage::StorageEnv.instance.requested_lvm_reuse).to be false
+      end
+    end
+
+    context "YAST_REUSE_LVM not set" do
+      let(:env_vars) do
+        {}
+      end
+
+      it "returns nil" do
+        expect(Y2Storage::StorageEnv.instance.requested_lvm_reuse).to be nil
+      end
+    end
+  end
 end

Reply via email to