From 136f37450316fe98ae5128fd64508076c7f058ad Mon Sep 17 00:00:00 2001 From: Josef Reidinger Date: Wed, 23 Oct 2024 13:17:59 +0200 Subject: [PATCH 1/2] more robust parsing of blacklisted modules (bsc#1231313) --- .../installation/clients/copy_files_finish.rb | 2 +- test/copy_files_finish_test.rb | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/lib/installation/clients/copy_files_finish.rb b/src/lib/installation/clients/copy_files_finish.rb index e9f4bd149..4139ee557 100644 --- a/src/lib/installation/clients/copy_files_finish.rb +++ b/src/lib/installation/clients/copy_files_finish.rb @@ -190,7 +190,7 @@ def adjust_modprobe_blacklist end # comma-separated list of modules - blacklisted_modules = brokenmodules.split(", ") + blacklisted_modules = brokenmodules.split(/\s*,\s*/) # run before SCR switch blacklist_file = ::File.join( diff --git a/test/copy_files_finish_test.rb b/test/copy_files_finish_test.rb index 29e087731..47844b5a3 100755 --- a/test/copy_files_finish_test.rb +++ b/test/copy_files_finish_test.rb @@ -97,6 +97,22 @@ subject.write end + it "handles spaces around blacklist files (bsc#1231313)" do + allow(Yast::Linuxrc).to receive(:InstallInf).with("BrokenModules") + .and_return("moduleA,moduleB , moduleC") + allow(::File).to receive(:exist?).with(blacklist_file).and_return(false) + + expect(::File).to receive(:write).with(blacklist_file, String) do |_path, content| + expect(content).to_not match(/^$/) # no empty lines + expect(content).to match(/# Note: Entries added during installation\/update/) + expect(content).to match(/blacklist moduleA/) + expect(content).to match(/blacklist moduleB/) + expect(content).to match(/blacklist moduleC/) + end + + subject.write + end + it "copies information about hardware status" do expect(::FileUtils).to receive(:mkdir_p).with("/mnt/var/lib") expect(Yast::WFM).to receive(:Execute).with(path(".local.bash"), /cp.*\/var\/lib\/hardware/) From de0e13154768b032505072291d8df289e43f89be Mon Sep 17 00:00:00 2001 From: Josef Reidinger Date: Wed, 23 Oct 2024 13:18:55 +0200 Subject: [PATCH 2/2] changes --- package/yast2-installation.changes | 7 +++++++ package/yast2-installation.spec | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/package/yast2-installation.changes b/package/yast2-installation.changes index d34be7264..e4306f5c3 100644 --- a/package/yast2-installation.changes +++ b/package/yast2-installation.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Oct 23 11:18:09 UTC 2024 - Josef Reidinger + +- Improve handling spaces when list of blacklisted modules are + specified (bsc#1231313) +- 4.7.1 + ------------------------------------------------------------------- Fri Sep 06 07:14:32 UTC 2024 - Ladislav Slezák diff --git a/package/yast2-installation.spec b/package/yast2-installation.spec index 884bffb50..c64314caf 100644 --- a/package/yast2-installation.spec +++ b/package/yast2-installation.spec @@ -16,7 +16,7 @@ # Name: yast2-installation -Version: 4.7.0 +Version: 4.7.1 Release: 0 Summary: YaST2 - Installation Parts License: GPL-2.0-only