Hello community, here is the log from the commit of package yast2-tune for openSUSE:Factory checked in at 2019-10-16 09:09:35 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-tune (Old) and /work/SRC/openSUSE:Factory/.yast2-tune.new.2352 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-tune" Wed Oct 16 09:09:35 2019 rev:65 rq:735883 version:4.2.1 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-tune/yast2-tune.changes 2019-07-31 14:18:16.334677048 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-tune.new.2352/yast2-tune.changes 2019-10-16 09:09:38.304340783 +0200 @@ -1,0 +2,6 @@ +Fri Oct 4 13:30:49 UTC 2019 - Imobach Gonzalez Sosa <[email protected]> + +- Place sysctl settings in /etc/sysctl.d/ (jsc#SLE-9077). +- 4.2.1 + +------------------------------------------------------------------- Old: ---- yast2-tune-4.2.0.tar.bz2 New: ---- yast2-tune-4.2.1.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-tune.spec ++++++ --- /var/tmp/diff_new_pack.0rWzJk/_old 2019-10-16 09:09:38.668339845 +0200 +++ /var/tmp/diff_new_pack.0rWzJk/_new 2019-10-16 09:09:38.668339845 +0200 @@ -17,7 +17,7 @@ Name: yast2-tune -Version: 4.2.0 +Version: 4.2.1 Release: 0 Summary: YaST2 - Hardware Tuning License: GPL-2.0-or-later @@ -27,12 +27,12 @@ Source0: %{name}-%{version}.tar.bz2 BuildRequires: update-desktop-files -BuildRequires: yast2 +# CFA::Sysctl +BuildRequires: yast2 >= 4.2.25 BuildRequires: yast2-devtools >= 4.2.2 -# hwinfo/classnames.ycp -# Wizard::SetDesktopTitleAndIcon -Requires: yast2 >= 2.21.22 +# CFA::Sysctl +Requires: yast2 >= 4.2.25 Requires: yast2-bootloader Requires: yast2-ruby-bindings >= 1.0.0 ++++++ yast2-tune-4.2.0.tar.bz2 -> yast2-tune-4.2.1.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-tune-4.2.0/package/yast2-tune.changes new/yast2-tune-4.2.1/package/yast2-tune.changes --- old/yast2-tune-4.2.0/package/yast2-tune.changes 2019-06-04 10:13:09.000000000 +0200 +++ new/yast2-tune-4.2.1/package/yast2-tune.changes 2019-10-07 16:50:37.000000000 +0200 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Fri Oct 4 13:30:49 UTC 2019 - Imobach Gonzalez Sosa <[email protected]> + +- Place sysctl settings in /etc/sysctl.d/ (jsc#SLE-9077). +- 4.2.1 + +------------------------------------------------------------------- Fri May 31 12:41:37 UTC 2019 - Stasiek Michalski <[email protected]> - Add metainfo (fate#319035) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-tune-4.2.0/package/yast2-tune.spec new/yast2-tune-4.2.1/package/yast2-tune.spec --- old/yast2-tune-4.2.0/package/yast2-tune.spec 2019-06-04 10:13:09.000000000 +0200 +++ new/yast2-tune-4.2.1/package/yast2-tune.spec 2019-10-07 16:50:37.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-tune -Version: 4.2.0 +Version: 4.2.1 Release: 0 Summary: YaST2 - Hardware Tuning License: GPL-2.0-or-later @@ -27,12 +27,12 @@ Source0: %{name}-%{version}.tar.bz2 BuildRequires: update-desktop-files -BuildRequires: yast2 +# CFA::Sysctl +BuildRequires: yast2 >= 4.2.25 BuildRequires: yast2-devtools >= 4.2.2 -# hwinfo/classnames.ycp -# Wizard::SetDesktopTitleAndIcon -Requires: yast2 >= 2.21.22 +# CFA::Sysctl +Requires: yast2 >= 4.2.25 Requires: yast2-bootloader Requires: yast2-ruby-bindings >= 1.0.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-tune-4.2.0/src/modules/SystemSettings.rb new/yast2-tune-4.2.1/src/modules/SystemSettings.rb --- old/yast2-tune-4.2.0/src/modules/SystemSettings.rb 2019-06-04 10:13:09.000000000 +0200 +++ new/yast2-tune-4.2.1/src/modules/SystemSettings.rb 2019-10-07 16:50:37.000000000 +0200 @@ -10,6 +10,7 @@ # This module manages the System and Kernel settings such as I/O Scheduler type, # SysRq Keys... require "yast" +require "cfa/sysctl" module Yast class SystemSettingsClass < Module @@ -23,10 +24,11 @@ Yast.import "Mode" # Internal Data + @elevator = nil @enable_sysrq = nil @kernel_sysrq = nil + @sysctl_file = nil @sysctl_sysrq = nil - @elevator = nil @modified = false end @@ -118,7 +120,7 @@ return end - value_string = value ? "1" : "0" + value_string = value ? "1" : "0" if value_string != enable_sysrq @modified = true self.enable_sysrq = value_string @@ -181,7 +183,7 @@ # @return [String] Configuration value; returns an empty string if it's not set. def sysctl_sysrq return @sysctl_sysrq if @sysctl_sysrq - @sysctl_sysrq = SCR.Read(path(".etc.sysctl_conf.\"kernel.sysrq\"")) + @sysctl_sysrq = sysctl_file.kernel_sysrq log.info("SysRq enabled: #{@sysctl_sysrq}") @sysctl_sysrq end @@ -316,8 +318,8 @@ end log.info("Saving ENABLE_SYSRQ: #{enable_sysrq}") - SCR.Write(path(".etc.sysctl_conf.\"kernel.sysrq\""), enable_sysrq) - SCR.Write(path(".etc.sysctl_conf"), nil) + sysctl_file.kernel_sysrq = enable_sysrq + sysctl_file.save end # Write IO Scheduler settings @@ -331,6 +333,20 @@ Bootloader.Write if Mode.normal true end + + private + + # Returns the sysctl configuration + # + # @note It memoizes the value until {#main} is called. + # + # @return [Yast2::CFA::Sysctl] + def sysctl_file + return @sysctl_file if @sysctl_file + @sysctl_file = CFA::Sysctl.new + @sysctl_file.load + @sysctl_file + end end SystemSettings = SystemSettingsClass.new diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-tune-4.2.0/test/system_settings_test.rb new/yast2-tune-4.2.1/test/system_settings_test.rb --- old/yast2-tune-4.2.0/test/system_settings_test.rb 2019-06-04 10:13:09.000000000 +0200 +++ new/yast2-tune-4.2.1/test/system_settings_test.rb 2019-10-07 16:50:37.000000000 +0200 @@ -10,12 +10,16 @@ subject(:settings) { Yast::SystemSettings } let(:scheduler) { "cfq" } + let(:sysctl_file) { CFA::Sysctl.new } before do allow(File).to receive(:exist?).and_return(true) allow(Yast::Bootloader).to receive(:Read) allow(Yast::Bootloader).to receive(:kernel_param) .with(:common, "elevator").and_return(scheduler) + allow(CFA::Sysctl).to receive(:new).and_return(sysctl_file) + allow(sysctl_file).to receive(:load) + allow(sysctl_file).to receive(:save) settings.main end @@ -30,9 +34,7 @@ let(:sysctl_sysrq) { "1" } before do - allow(Yast::SCR).to receive(:Read) - .with(Yast::Path.new(".etc.sysctl_conf.\"kernel.sysrq\"")) - .and_return(sysctl_sysrq) + allow(sysctl_file).to receive(:kernel_sysrq).and_return(sysctl_sysrq) allow(File).to receive(:read).with(KERNEL_SYSRQ_FILE) .and_return(kernel_sysrq) allow(Yast::Bootloader).to receive(:kernel_param) @@ -219,9 +221,7 @@ allow(Yast::Mode).to receive(:mode).and_return(mode) allow(Yast::Bootloader).to receive(:Write) allow(Yast::SCR).to receive(:Read).and_call_original - allow(Yast::SCR).to receive(:Read) - .with(Yast::Path.new(".etc.sysctl_conf.\"kernel.sysrq\"")) - .and_return(sysctl_sysrq) + allow(sysctl_file).to receive(:kernel_sysrq).and_return(sysctl_sysrq) end context "when system settings has been read" do @@ -231,10 +231,7 @@ let(:sysctl_sysrq) { "0" } it "updates sysctl configuration" do - expect(Yast::SCR).to receive(:Write) - .with(Yast::Path.new(".etc.sysctl_conf.\"kernel.sysrq\""), sysctl_sysrq) - expect(Yast::SCR).to receive(:Write) - .with(Yast::Path.new(".etc.sysctl_conf"), nil) + expect(sysctl_file).to receive(:kernel_sysrq=).with(sysctl_sysrq) settings.Write end end @@ -243,8 +240,7 @@ let(:sysctl_sysrq) { "-1" } it "does not update sysctl configuration" do - expect(Yast::SCR).to_not receive(:Write) - .with(Yast::Path.new(".etc.sysctl_conf.\"kernel.sysrq\""), sysctl_sysrq) + expect(sysctl_file).to_not receive(:kernel_sysrq=) settings.Write end end @@ -266,8 +262,7 @@ context "when system settings hadn't been read" do it "does not update sysctl configuration" do - expect(Yast::SCR).to_not receive(:Write) - .with(Yast::Path.new(".etc.sysctl_conf.\"kernel_sysrq\""), anything) + expect(sysctl_file).to_not receive(:kernel_sysrq=) settings.Write end end @@ -309,9 +304,7 @@ describe "#SetSysRqKeysEnabled" do before do allow(Yast::SCR).to receive(:Read).and_call_original - allow(Yast::SCR).to receive(:Read) - .with(Yast::Path.new(".etc.sysctl_conf.\"kernel.sysrq\"")) - .and_return(sysctl_sysrq) + allow(sysctl_file).to receive(:kernel_sysrq).and_return(sysctl_sysrq) settings.Read end
