Hello community, here is the log from the commit of package yast2 for openSUSE:Factory checked in at 2020-03-01 21:27:02 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2 (Old) and /work/SRC/openSUSE:Factory/.yast2.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2" Sun Mar 1 21:27:02 2020 rev:473 rq:779355 version:4.2.67 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2/yast2.changes 2020-01-30 09:41:37.609497362 +0100 +++ /work/SRC/openSUSE:Factory/.yast2.new.26092/yast2.changes 2020-03-01 21:27:16.832467079 +0100 @@ -1,0 +2,46 @@ +Wed Feb 26 10:42:42 CET 2020 - [email protected] + +- Updated docu for SysctlConfig class (bsc#1151649). + +------------------------------------------------------------------- +Mon Feb 24 15:02:15 CET 2020 - [email protected] + +- Creating an own Augeas instance for each parsed sysctl file + (bsc#1151649). +- 4.2.67 + +------------------------------------------------------------------- +Mon Feb 17 17:59:07 UTC 2020 - [email protected] + +- SysctlConfig class: Handle sysctl entries in different + directories (bsc#1151649). +- 4.2.66 + +------------------------------------------------------------------- +Mon Feb 17 16:59:07 UTC 2020 - Stefan Hundhammer <[email protected]> + +- Fixed user-visible messages (bsc#1084015) +- 4.2.65 + +------------------------------------------------------------------- +Tue Feb 4 14:15:37 UTC 2020 - Josef Reidinger <[email protected]> + +- Show on WSL only WSL capable modules in control center + (bsc#1162650) +- 4.2.64 + +------------------------------------------------------------------- +Fri Jan 31 16:07:35 UTC 2020 - José Iván López González <[email protected]> + +- Add new widgets CWM::ProgressBar and CWM::DynamicProgressBar. +- Needed for bsc#1135366. +- 4.2.63 + +------------------------------------------------------------------- +Thu Jan 30 11:19:00 UTC 2020 - Ladislav Slezák <[email protected]> + +- Do not crash when the "software/base_products" is not defined + in the control.xml (bsc#1161956) +- 4.2.62 + +------------------------------------------------------------------- Old: ---- yast2-4.2.61.tar.bz2 New: ---- yast2-4.2.67.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2.spec ++++++ --- /var/tmp/diff_new_pack.q1XDxA/_old 2020-03-01 21:27:18.508470484 +0100 +++ /var/tmp/diff_new_pack.q1XDxA/_new 2020-03-01 21:27:18.516470500 +0100 @@ -17,7 +17,7 @@ Name: yast2 -Version: 4.2.61 +Version: 4.2.67 Release: 0 Summary: YaST2 Main Package License: GPL-2.0-only ++++++ yast2-4.2.61.tar.bz2 -> yast2-4.2.67.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.2.61/library/cwm/src/lib/cwm/dynamic_progress_bar.rb new/yast2-4.2.67/library/cwm/src/lib/cwm/dynamic_progress_bar.rb --- old/yast2-4.2.61/library/cwm/src/lib/cwm/dynamic_progress_bar.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-4.2.67/library/cwm/src/lib/cwm/dynamic_progress_bar.rb 2020-02-26 11:31:10.000000000 +0100 @@ -0,0 +1,86 @@ +# Copyright (c) [2020] SUSE LLC +# +# All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 of the GNU General Public License as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, contact SUSE LLC. +# +# To contact SUSE LLC about this file by physical or electronic mail, you may +# find current contact information at www.suse.com. + +require "abstract_method" +require "cwm/progress_bar" + +module CWM + # Widget for a dynamic progress bar, where the label can be set for every step. + # + # This progress bar is useful when steps are not known in advance or part of them are dynamically + # generated. + # + # @example + # + # class MyProgressBar < CWM::DynamicProgessBar + # def steps_count + # 3 + # end + # + # def label + # "Progress" + # end + # end + # + # pg = MyProgressBar.new + # + # pg.forward("step 1") #=> shows label "step 1" + # pg.forward #=> shows label "Progress" + # pg.forward("step 3") #=> shows label "step 3" + class DynamicProgressBar < ProgressBar + # Moves the progress forward and sets the given step as label + # + # @see ProgressBar#forward + def forward(step = nil) + next_step(step) if step + + super() + end + + # @!method label + # + # Label for the progress bar when no step is given, see {#forward}. + # + # @return [String] + abstract_method :label + + # @!method steps_count + # + # Number of steps + # + # @return [Integer] + abstract_method :steps_count + + private + + # @see ProgressBar#steps + def steps + @steps ||= [label] * steps_count + end + + # Sets the label for the next step + # + # @param step [String] + def next_step(step) + return if complete? + + steps[current_step_index + 1] = step + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.2.61/library/cwm/src/lib/cwm/progress_bar.rb new/yast2-4.2.67/library/cwm/src/lib/cwm/progress_bar.rb --- old/yast2-4.2.61/library/cwm/src/lib/cwm/progress_bar.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-4.2.67/library/cwm/src/lib/cwm/progress_bar.rb 2020-02-26 11:31:10.000000000 +0100 @@ -0,0 +1,120 @@ +# Copyright (c) [2020] SUSE LLC +# +# All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 of the GNU General Public License as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, contact SUSE LLC. +# +# To contact SUSE LLC about this file by physical or electronic mail, you may +# find current contact information at www.suse.com. + +require "abstract_method" +require "cwm/custom_widget" + +module CWM + # Widget for a progress bar + # + # @example + # + # class MyProgressBar < CWM::ProgessBar + # def steps + # ["step 1", "step 2", "step 3"] + # end + # end + # + # pg = MyProgressBar.new + # + # pg.forward #=> shows label "step 1" + # pg.forward #=> shows label "step 2" + # pg.forward #=> shows label "step 3" + class ProgressBar < CustomWidget + # Constructor + def initialize + super + + @current_step_index = 0 + end + + # @see CWM::CustomWidget#contents + def contents + ProgressBar(Id(widget_id), current_label, total_steps, current_step_index) + end + + # Moves the progress forward and sets the next step as label if needed (see #show_steps?) + def forward + return if complete? + + @current_step_index += 1 + + refresh + end + + # @!method steps + # + # Steps for the progress bar + # + # @return [Array<String>] + abstract_method :steps + + private + + # Index to the current step + # + # @return [Integer] + attr_reader :current_step_index + + # Whether the steps should be used for the label of the progress bar + # + # @return [Boolean] if false, no label is shown + def show_steps? + true + end + + # Total number of steps + # + # @return [Integer] + def total_steps + steps.size + end + + # Label to use for the current step + # + # @see {#show_steps?} + # + # @return [String] + def current_label + label = show_steps? ? current_step : nil + + label || "" + end + + # Current step + # + # @return [String] + def current_step + steps[current_step_index] + end + + # Whether the progress bar is already complete + # + # @return [Boolean] + def complete? + current_step_index == total_steps + end + + # Refreshes the progress bar according to the current step + def refresh + Yast::UI.ChangeWidget(Id(widget_id), :Value, current_step_index) + Yast::UI.ChangeWidget(Id(widget_id), :Label, current_label) + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.2.61/library/cwm/src/lib/cwm/rspec.rb new/yast2-4.2.67/library/cwm/src/lib/cwm/rspec.rb --- old/yast2-4.2.61/library/cwm/src/lib/cwm/rspec.rb 2020-01-29 15:00:05.000000000 +0100 +++ new/yast2-4.2.67/library/cwm/src/lib/cwm/rspec.rb 2020-02-26 11:31:10.000000000 +0100 @@ -1,3 +1,22 @@ +# Copyright (c) [2017-2020] SUSE LLC +# +# All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 of the GNU General Public License as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, contact SUSE LLC. +# +# To contact SUSE LLC about this file by physical or electronic mail, you may +# find current contact information at www.suse.com. + # in your specs: # require "cwm/rspec" @@ -225,3 +244,30 @@ end end end + +RSpec.shared_examples "CWM::ProgressBar" do + include_examples "CWM::CustomWidget" + + describe "#steps" do + it "produces an Array of String" do + expect(subject.send(:steps)).to be_an Array + expect(subject.send(:steps)).to all(be_a(String)) + end + end +end + +RSpec.shared_examples "CWM::DynamicProgressBar" do + include_examples "CWM::ProgressBar" + + describe "#label" do + it "produces an String or nil" do + expect(subject.send(:label)).to be_a(String).or(be_nil) + end + end + + describe "#steps_count" do + it "produces an Integer" do + expect(subject.send(:steps_count)).to be_a(Integer) + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.2.61/library/cwm/src/lib/cwm/widget.rb new/yast2-4.2.67/library/cwm/src/lib/cwm/widget.rb --- old/yast2-4.2.61/library/cwm/src/lib/cwm/widget.rb 2020-01-29 15:00:05.000000000 +0100 +++ new/yast2-4.2.67/library/cwm/src/lib/cwm/widget.rb 2020-02-26 11:31:10.000000000 +0100 @@ -1,8 +1,29 @@ +# Copyright (c) [2016-2020] SUSE LLC +# +# All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 of the GNU General Public License as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, contact SUSE LLC. +# +# To contact SUSE LLC about this file by physical or electronic mail, you may +# find current contact information at www.suse.com. + require "yast" require "cwm/abstract_widget" require "cwm/custom_widget" require "cwm/common_widgets" +require "cwm/dynamic_progress_bar" +require "cwm/progress_bar" require "cwm/table" require "cwm/tabs" require "cwm/tree" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.2.61/library/cwm/test/dynamic_progress_bar_test.rb new/yast2-4.2.67/library/cwm/test/dynamic_progress_bar_test.rb --- old/yast2-4.2.61/library/cwm/test/dynamic_progress_bar_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-4.2.67/library/cwm/test/dynamic_progress_bar_test.rb 2020-02-26 11:31:10.000000000 +0100 @@ -0,0 +1,69 @@ +#! /usr/bin/env rspec --format doc + +# Copyright (c) [2020] SUSE LLC +# +# All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 of the GNU General Public License as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, contact SUSE LLC. +# +# To contact SUSE LLC about this file by physical or electronic mail, you may +# find current contact information at www.suse.com. + +require_relative "test_helper" + +require "cwm/rspec" +require "cwm/dynamic_progress_bar" + +Yast.import "UI" + +describe CWM::DynamicProgressBar do + class TestDynamicProgressBar < CWM::DynamicProgressBar + def steps_count + 3 + end + + def label + "Progress" + end + end + + subject { TestDynamicProgressBar.new } + + include_examples "CWM::DynamicProgressBar" + + describe "#forward" do + before do + allow(Yast::UI).to receive(:ChangeWidget).with(anything, :Label, anything) + + allow(Yast::UI).to receive(:ChangeWidget).with(anything, :Value, anything) + end + + context "when the step is given" do + let(:step) { "step 1" } + + it "updates the label according to the given step" do + expect(Yast::UI).to receive(:ChangeWidget).with(anything, :Label, step) + + subject.forward(step) + end + end + + context "when the step is not given" do + it "updates the label according to the defined label" do + expect(Yast::UI).to receive(:ChangeWidget).with(anything, :Label, "Progress") + + subject.forward + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.2.61/library/cwm/test/progress_bar_test.rb new/yast2-4.2.67/library/cwm/test/progress_bar_test.rb --- old/yast2-4.2.61/library/cwm/test/progress_bar_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-4.2.67/library/cwm/test/progress_bar_test.rb 2020-02-26 11:31:10.000000000 +0100 @@ -0,0 +1,96 @@ +#! /usr/bin/env rspec --format doc + +# Copyright (c) [2020] SUSE LLC +# +# All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 of the GNU General Public License as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, contact SUSE LLC. +# +# To contact SUSE LLC about this file by physical or electronic mail, you may +# find current contact information at www.suse.com. + +require_relative "test_helper" + +require "cwm/rspec" +require "cwm/progress_bar" + +Yast.import "UI" + +describe CWM::ProgressBar do + class TestProgressBar < CWM::ProgressBar + def steps + ["step 1", "step 2", "step 3"] + end + end + + subject { TestProgressBar.new } + + include_examples "CWM::ProgressBar" + + describe "#forward" do + before do + allow(Yast::UI).to receive(:ChangeWidget).with(anything, :Label, anything) + + allow(Yast::UI).to receive(:ChangeWidget).with(anything, :Value, anything) + end + + context "when the progress bar is complete" do + before do + 3.times { subject.forward } + end + + it "does not modify the progress bar" do + expect(Yast::UI).to_not receive(:ChangeWidget).with(anything, :Value, anything) + expect(Yast::UI).to_not receive(:ChangeWidget).with(anything, :Label, anything) + + subject.forward + end + end + + context "when the progress bar is not complete" do + before do + subject.forward # there are three steps + end + + it "moves progress forward" do + expect(Yast::UI).to_not receive(:ChangeWidget).with(anything, :Value, 1) + + subject.forward + end + + context "and steps should be shown" do + before do + allow(subject).to receive(:show_steps?).and_return(true) + end + + it "updates the label according to the step" do + expect(Yast::UI).to_not receive(:ChangeWidget).with(anything, :Label, "step 2") + + subject.forward + end + end + + context "and steps should not be shown" do + before do + allow(subject).to receive(:show_steps?).and_return(false) + end + + it "shows an empty label" do + expect(Yast::UI).to receive(:ChangeWidget).with(anything, :Label, "") + + subject.forward + end + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.2.61/library/desktop/src/clients/menu.rb new/yast2-4.2.67/library/desktop/src/clients/menu.rb --- old/yast2-4.2.61/library/desktop/src/clients/menu.rb 2020-01-29 15:00:05.000000000 +0100 +++ new/yast2-4.2.67/library/desktop/src/clients/menu.rb 2020-02-26 11:31:10.000000000 +0100 @@ -62,6 +62,7 @@ "X-SuSE-YaST-Group", "X-SuSE-YaST-SortKey", "X-SuSE-YaST-RootOnly", + "X-SuSE-YaST-WSL", "Hidden" ] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.2.61/library/desktop/src/modules/Desktop.rb new/yast2-4.2.67/library/desktop/src/modules/Desktop.rb --- old/yast2-4.2.61/library/desktop/src/modules/Desktop.rb 2020-01-29 15:00:05.000000000 +0100 +++ new/yast2-4.2.67/library/desktop/src/modules/Desktop.rb 2020-02-26 11:31:10.000000000 +0100 @@ -32,6 +32,7 @@ def main Yast.import "UI" textdomain "base" + Yast.import "Arch" Yast.import "Map" Yast.import "Directory" @@ -111,7 +112,7 @@ end # Read module and group data from desktop files - # @param [Array<String>] Values list of values to be parsed (empty to read all) + # @param [Array<String>] Values list of values to be parsed (empty or nil reads nothing) def Read(values_to_parse) values_to_parse = deep_copy(values_to_parse) extract_desktop_filename = lambda do |fullpath| @@ -258,12 +259,11 @@ end Builtins.foreach(mods) do |m| - if Builtins.haskey(@Modules, m) && - Ops.get_string(@Modules, [m, "Hidden"], "false") != "true" - l = Builtins.add( - l, - Item(Id(m), Ops.get_string(@Modules, [m, "GenericName"], "???")) - ) + if @Modules[m].is_a?(::Hash) && + @Modules[m]["Hidden"] != "true" && + # wsl specific whitelisting of modules + (!Arch.is_wsl || @Modules[m]["X-SuSE-YaST-WSL"] == "true") + l << Item(Id(m), Ops.get_string(@Modules, [m, "GenericName"], "???")) end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.2.61/library/desktop/test/data/usr/share/applications/YaST2/org.opensuse.yast.SWSingle.desktop new/yast2-4.2.67/library/desktop/test/data/usr/share/applications/YaST2/org.opensuse.yast.SWSingle.desktop --- old/yast2-4.2.61/library/desktop/test/data/usr/share/applications/YaST2/org.opensuse.yast.SWSingle.desktop 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-4.2.67/library/desktop/test/data/usr/share/applications/YaST2/org.opensuse.yast.SWSingle.desktop 2020-02-26 11:31:10.000000000 +0100 @@ -0,0 +1,27 @@ +[Desktop Entry] +X-SuSE-DocTeamID=ycc_org.opensuse.yast.SWSingle +Type=Application +Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Software; + +X-KDE-ModuleType=Library +X-KDE-HasReadOnlyMode=true +X-SuSE-YaST-Call=sw_single + +X-SuSE-YaST-Group=Software +X-SuSE-YaST-Argument= +X-SuSE-YaST-RootOnly=true +X-SuSE-YaST-WSL=true +X-SuSE-YaST-AutoInst= +X-SuSE-YaST-Geometry= +X-SuSE-YaST-SortKey=20 +X-SuSE-YaST-AutoInstResource= +X-SuSE-YaST-Keywords=software,packages,rpm,repositories,installation,deletion + +Icon=yast-sw_single +Exec=xdg-su -c "/sbin/yast2 sw_single" + +Name=YaST Software Management +GenericName=Software Management +Comment=Install or remove software packages and manage software repositories +StartupNotify=true + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.2.61/library/desktop/test/desktop_test.rb new/yast2-4.2.67/library/desktop/test/desktop_test.rb --- old/yast2-4.2.61/library/desktop/test/desktop_test.rb 2020-01-29 15:00:05.000000000 +0100 +++ new/yast2-4.2.67/library/desktop/test/desktop_test.rb 2020-02-26 11:31:10.000000000 +0100 @@ -34,9 +34,58 @@ "add-on" => { "Name" => "YaST Add-On Products" }, "lan" => { "Name" => "YaST Network" }, "services-manager" => { "Name" => "YaST Services Manager" }, + "sw-single" => { "Name" => "YaST Software Management" }, "s390-extra" => { "Name" => "YaST S390 Extra" }, "dns-server" => { "Name" => "YaST DNS Server" } ) end end + + describe ".ModuleList" do + around { |e| change_scr_root(DESKTOP_DATA_PATH, &e) } + + let(:read_values) do + # TODO: really MEH API, copy of menu.rb list + [ + "GenericName", + # not required: "Comment", + "X-SuSE-YaST-Argument", + "X-SuSE-YaST-Call", + "X-SuSE-YaST-Group", + "X-SuSE-YaST-SortKey", + "X-SuSE-YaST-RootOnly", + "X-SuSE-YaST-WSL", + "Hidden" + ] + end + + before do + Yast::Desktop.Read(read_values) + # as changed scr does not have groups desktop, define it manually here + Yast::Desktop.Groups = { "Software" => { "modules" => ["add-on", "sw-single"] } } + end + + context "on WSL" do + before do + allow(Yast::Arch).to receive(:is_wsl).and_return(true) + end + + it "returns only whitelisted modules" do + expect(Yast::Desktop.ModuleList("Software")).to eq [Yast::Term.new(:item, Yast::Term.new(:id, "sw-single"), "Software Management")] + end + end + + context "outside of WSL" do + before do + allow(Yast::Arch).to receive(:is_wsl).and_return(false) + end + + it "ignores WSL whitelisting" do + expect(Yast::Desktop.ModuleList("Software")).to eq [ + Yast::Term.new(:item, Yast::Term.new(:id, "sw-single"), "Software Management"), + Yast::Term.new(:item, Yast::Term.new(:id, "add-on"), "Add-On Products") + ] + end + end + end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.2.61/library/general/src/lib/cfa/conflict_report.rb new/yast2-4.2.67/library/general/src/lib/cfa/conflict_report.rb --- old/yast2-4.2.61/library/general/src/lib/cfa/conflict_report.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-4.2.67/library/general/src/lib/cfa/conflict_report.rb 2020-02-26 11:31:10.000000000 +0100 @@ -0,0 +1,50 @@ +# Copyright (c) [2020] SUSE LLC +# +# All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 of the GNU General Public License as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, contact SUSE LLC. +# +# To contact SUSE LLC about this file by physical or electronic mail, you may +# find current contact information at www.suse.com. + +require "yast" + +Yast.import "Report" + +module CFA + # Class for showing conflicts. + class ConfictReport + include Yast::Logger + include Yast::I18n + extend Yast::I18n + + # Popup which shows the conflicting files and their attributes. + # + # @param conflicts [Hash<String, Array<String>>] conflicting filepath with the + # corresponding array of entry names. + def self.report(conflicts) + textdomain "base" + return if !conflicts || conflicts.empty? + + text = "" + text << _("Changed values have conflicts with:<br><br>") + conflicts.each do |filename, conflict| + text << _("File: %s<br>") % filename + text << _("Conflicting entries: %s<br>") % conflict.join(", ") + text << "<br>" + end + text << _("You will have to adapt these entries manually in order to set your changes.") + Yast::Report.LongWarning(text) + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.2.61/library/general/src/lib/cfa/sysctl.rb new/yast2-4.2.67/library/general/src/lib/cfa/sysctl.rb --- old/yast2-4.2.61/library/general/src/lib/cfa/sysctl.rb 2020-01-29 15:00:05.000000000 +0100 +++ new/yast2-4.2.67/library/general/src/lib/cfa/sysctl.rb 2020-02-26 11:31:10.000000000 +0100 @@ -1,4 +1,4 @@ -# Copyright (c) [2019] SUSE LLC +# Copyright (c) [2019-2020] SUSE LLC # # All Rights Reserved. # @@ -42,16 +42,24 @@ # sysctl.load # sysctl.raw_forward_ipv6 #=> "0" # sysctl.raw_forward_ipv6 = "1" - # sysctl.forward_ipv6? #=> true + # + # NOTE: This class only handles "/etc/sysctl.d/70-yast.conf" and /etc/sysctl.conf. + # But sysctl values will also be handled by other files/directories. This will be + # managed by class SysctlConfig. So please use SysctlConfig in order to read/write + # sysctl values. class Sysctl < BaseModel include Yast::Logger Yast.import "Stage" - PARSER = AugeasParser.new("sysctl.lns") PATH = "/etc/sysctl.d/70-yast.conf".freeze class << self + def known_attributes + # Returning all attributes + ATTRIBUTES.keys + end + # Modifies default CFA methods to handle boolean values # # When getting or setting the value, a boolean value will be expected. Under the hood, it will @@ -91,17 +99,28 @@ disable_ipv6: "net.ipv6.conf.all.disable_ipv6" }.freeze + BOOLEAN_ATTRIBUTES = [ + :forward_ipv4, :forward_ipv6, :tcp_syncookies, :disable_ipv6, + :ipv4_forwarding_default, :ipv4_forwarding_all, :ipv6_forwarding_default, + :ipv6_forwarding_all + ].freeze + attributes(ATTRIBUTES) + attr_reader :file_path + # Keys that are handled by this class KNOWN_KEYS = ATTRIBUTES.values.uniq.freeze - boolean_attr :forward_ipv4, :forward_ipv6, :tcp_syncookies, :disable_ipv6, - :ipv4_forwarding_default, :ipv4_forwarding_all, :ipv6_forwarding_default, - :ipv6_forwarding_all + boolean_attr(*BOOLEAN_ATTRIBUTES) + + def initialize(file_handler: Yast::TargetFile, file_path: PATH) + super(AugeasParser.new("sysctl.lns"), file_path, file_handler: file_handler) + end - def initialize(file_handler: Yast::TargetFile) - super(PARSER, PATH, file_handler: file_handler) + def empty? + # FIXME: AugeasTree should implement #empty? + data.data.empty? end # Loads sysctl content @@ -138,8 +157,37 @@ clean_old_values if !Yast::Stage.initial end + def present?(attr) + !send(method_name(attr)).nil? + end + + # Returns the list of attributes + # + # @return [Array<Symbol>] List of attribute names + # @see #present? + def present_attributes + self.class.known_attributes.select { |a| present?(a) } + end + + # Determines the list of conflicting attributes for two files + # + # Two attributes are conflicting when both of them are defined with + # different values. + # + # @param other [BaseModel] The file to compare with + # @return [Array<Symbol>] List of conflicting attributes + def conflicts(other) + conflicting_attrs = present_attributes & other.present_attributes + conflicting_attrs.reject { |a| public_send(a) == other.public_send(a) } + end + private + def method_name(attr) + raw_method = "raw_#{attr}" + respond_to?(raw_method) ? raw_method : attr + end + # Path to the agent to handle the +/etc/sysctl.conf+ file SYSCTL_AGENT_PATH = Yast::Path.new(".etc.sysctl_conf") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.2.61/library/general/src/lib/cfa/sysctl_config.rb new/yast2-4.2.67/library/general/src/lib/cfa/sysctl_config.rb --- old/yast2-4.2.61/library/general/src/lib/cfa/sysctl_config.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-4.2.67/library/general/src/lib/cfa/sysctl_config.rb 2020-02-26 11:31:10.000000000 +0100 @@ -0,0 +1,190 @@ +# Copyright (c) [2019-2020] SUSE LLC +# +# All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 of the GNU General Public License as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, contact SUSE LLC. +# +# To contact SUSE LLC about this file by physical or electronic mail, you may +# find current contact information at www.suse.com. + +require "yast" +require "yast2/execute" +require "cfa/sysctl" +require "cfa/conflict_report" + +Yast.import "FileUtils" + +module CFA + # CFA based API to adjust the sysctl tool configuration + # + # This class does not modify the running kernel configuration. It just writes + # the desired values into the configuration file ({PATH}). + # Despite the class Sysctl this class also takes care about entries in + # /run/sysctl.d, + # /etc/sysctl.d + # /usr/local/lib/sysctl.d + # /usr/lib/sysctl.d + # /lib/sysctl.d + # /etc/sysctl.conf + # and inform the user if his settings will be overruled by setting in + # other files. + # + # @example Enabling IPv4 forwarding + # sysctl = SysctlConfig.new + # sysctl.forward_ipv4 = true + # sysctl.save + class SysctlConfig + include Yast::Logger + + PATHS = [ + "/run/sysctl.d", + "/etc/sysctl.d", + "/usr/local/lib/sysctl.d", + "/usr/lib/sysctl.d", + "/lib/sysctl.d", + "/etc/sysctl.conf" + ].freeze + private_constant :PATHS + + YAST_CONFIG_PATH = Sysctl::PATH + private_constant :YAST_CONFIG_PATH + + class << self + def define_attr(attr) + define_method attr do + file = files.reverse.find do |f| + f.present?(attr) + end + return file.public_send(attr) if file + + yast_config_file.public_send(attr) + end + + define_method "#{attr}=" do |value| + yast_config_file.public_send("#{attr}=", value) + end + end + end + + Sysctl.known_attributes.each { |a| define_attr(a) } + + def load + files.each(&:load) + end + + # Saving all sysctl settings + # + def save + yast_config_file&.save + end + + # Whether there is a conflict with given attributes + # + # @param only [Array<Symbol>] attributes to check + # @param show_information [Boolean] showing a popup if it is conflicting + # @return [Boolean] true if any conflict is found; false otherwise + def conflict?(only: [], show_information: true) + return false if yast_config_file.empty? + + conflicting_attrs = Sysctl::ATTRIBUTES.keys + conflicting_attrs &= only unless only.empty? + conflicts = {} + higher_precedence_files.each do |file| + # Checking all "higher" files if their values overrule the current + # YAST settings. + conflict_values = yast_config_file.conflicts(file) & conflicting_attrs + conflicts[file.file_path] = conflict_values unless conflict_values.empty? + end + + # Transform into real tags + conflicts.each do |file, tags| + conflicts[file] = tags.map { |t| Sysctl::ATTRIBUTES[t.to_sym] } + end + + if !conflicts.empty? + log.warn("It could be that #{YAST_CONFIG_PATH} will not be written.") + log.warn("There are conflicts in sysctl files: #{conflicts}.") + ConfictReport.report(conflicts) if show_information + end + + !conflicts.empty? + end + + def files + @files ||= config_paths.map { |file| Sysctl.new(file_path: file) } + end + + private + + def yast_config_file + @yast_config_file ||= files.find { |f| f.file_path == YAST_CONFIG_PATH } + end + + def lower_precedence_files + @lower_precedence_files ||= files[0...yast_config_file_idx] + end + + def higher_precedence_files + @higher_precedence_files ||= files[(yast_config_file_idx + 1)..-1] + end + + def config_paths + paths = PATHS.each_with_object([YAST_CONFIG_PATH]) do |path, all| + all.concat(file_paths_in(path)) + end + + paths.uniq! { |f| File.basename(f) } + # Sort files lexicographic + paths.sort_by! { |f| File.basename(f) } + + # Prepend the kernel configuration file + paths.unshift(boot_config_path) unless boot_config_path.empty? + + paths + end + + def file_paths_in(path) + if Yast::FileUtils.IsFile(path) + [path] + elsif Yast::FileUtils.IsDirectory(path) + Yast::SCR.Read(Yast::Path.new(".target.dir"), path).map { |file| File.join(path, file) } + else + log.debug("Ignoring not valid path: #{path}") + + [] + end + end + + def boot_config_path + return @boot_config_path if @boot_config_path + + @boot_config_path = if !kernel_version.empty? + "/boot/sysctl.conf-#{kernel_version}" + else + "" + end + end + + def boot_config_file + @boot_config_file ||= files.find { |f| f.file_path == boot_config_path } + end + + def kernel_version + @kernel_version ||= Yast::Execute.on_target.stdout("/usr/bin/uname", "-r").to_s.chomp + end + + def yast_config_file_idx + @yast_config_file_idx ||= files.find_index { |f| f == yast_config_file } + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.2.61/library/general/src/modules/FileUtils.rb new/yast2-4.2.67/library/general/src/modules/FileUtils.rb --- old/yast2-4.2.61/library/general/src/modules/FileUtils.rb 2020-01-29 15:00:05.000000000 +0100 +++ new/yast2-4.2.67/library/general/src/modules/FileUtils.rb 2020-02-26 11:31:10.000000000 +0100 @@ -283,7 +283,7 @@ # TRANSLATORS: popup question (with continue / cancel buttons) # %1 is the filesystem path _( - "Although the path %1 exists, it is not a directory.\nContinue or cancel the operation?\n" + "Although the path %1 exists, it is not a directory.\nContinue or cancel the operation?" ), pathvalue ) @@ -295,7 +295,7 @@ Builtins.sformat( # TRANSLATORS: question popup (with yes / no buttons). A user entered non-existent path # for a share, %1 is entered path - _("The path %1 does not exist.\nCreate it now?\n"), + _("The path %1 does not exist.\nCreate it now?"), pathvalue ) ) @@ -315,7 +315,7 @@ # TRANSLATORS: popup question (with continue / cancel buttons) # %1 is the name (path) of the directory _( - "Failed to create the directory %1.\nContinue or cancel the current operation?\n" + "Failed to create the directory %1.\nContinue or cancel the current operation?" ), pathvalue ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.2.61/library/general/test/cfa/sysctl_config_test.rb new/yast2-4.2.67/library/general/test/cfa/sysctl_config_test.rb --- old/yast2-4.2.61/library/general/test/cfa/sysctl_config_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-4.2.67/library/general/test/cfa/sysctl_config_test.rb 2020-02-26 11:31:10.000000000 +0100 @@ -0,0 +1,217 @@ +#!/usr/bin/env rspec + +# Copyright (c) [2019] SUSE LLC +# +# All Rights Reserved. +# +# This program is free software; you can redistribute it and/or modify it +# under the terms of version 2 of the GNU General Public License as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +# more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, contact SUSE LLC. +# +# To contact SUSE LLC about this file by physical or electronic mail, you may +# find current contact information at www.suse.com. + +require_relative "../test_helper" +require "cfa/sysctl_config" +require "cfa/sysctl" + +describe CFA::SysctlConfig do + subject(:config) { described_class.new } + + around do |example| + change_scr_root(File.join(GENERAL_DATA_PATH, "sysctl-full"), &example) + end + + describe "#load" do + let(:execute_object) { Yast::Execute.new } + + before do + allow(Yast::Execute).to receive(:on_target).and_return(execute_object) + allow(execute_object).to receive(:stdout).with("/usr/bin/uname", "-r").and_return("5.3.7-1-default") + end + + it "reads settings from files in all directories" do + files = [ + "/boot/sysctl.conf-5.3.7-1-default", + "/run/sysctl.d/05-syn_cookies.conf", + "/etc/sysctl.d/50-overriden.conf", + "/etc/sysctl.d/70-yast.conf", + "/usr/local/lib/sysctl.d/10-lib.conf", + "/usr/lib/sysctl.d/15-lib.conf", + "/lib/sysctl.d/20-lib.conf", + "/etc/sysctl.conf" + ] + files.each do |name| + expect(CFA::Sysctl).to receive(:new).with(file_path: name).and_call_original + end + + config.load + end + + it "settings for the given kernel are read from /boot" do + config.load + expect(config.kernel_sysrq).to eq("1") + end + + context "when two files have the same name" do + it "only reads the first one" do + expect(CFA::Sysctl).to_not receive(:new).with(file_path: "/lib/sysctl.d/50-overriden.conf") + allow(CFA::Sysctl).to receive(:new).and_call_original + config.load + end + end + end + + describe "#files" do + let(:execute_object) { Yast::Execute.new } + + context "when a specific kernel flavor configuration is found" do + before do + allow(Yast::Execute).to receive(:on_target).and_return(execute_object) + allow(execute_object).to receive(:stdout).with("/usr/bin/uname", "-r").and_return("5.3.7-1-default") + end + + it "includes it in the first position" do + expect(config.files[0].file_path).to eq("/boot/sysctl.conf-5.3.7-1-default") + end + + it "does not include other kernel configurations" do + expect(config.files.map(&:file_path)).to_not include(/5.3.6-1-default/) + end + + it "includes the other configuration files lexicographically ordered" do + expect(config.files[1..-1].map(&:file_path)).to eq([ + "/run/sysctl.d/05-syn_cookies.conf", "/usr/local/lib/sysctl.d/10-lib.conf", + "/usr/lib/sysctl.d/15-lib.conf", "/lib/sysctl.d/20-lib.conf", + "/etc/sysctl.d/50-overriden.conf", "/etc/sysctl.d/70-yast.conf", "/etc/sysctl.conf" + ]) + end + end + + context "when no specific kernel configurations are found" do + before do + allow(Yast::Execute).to receive(:on_target).and_return(execute_object) + allow(execute_object).to receive(:stdout).with("/usr/bin/uname", "-r").and_return("") + end + + it "does not include /boot" do + expect(config.files.map(&:file_path)).to_not include(/\/boot/) + end + + it "includes configuration files lexicographically ordered" do + expect(config.files.map(&:file_path)).to eq([ + "/run/sysctl.d/05-syn_cookies.conf", "/usr/local/lib/sysctl.d/10-lib.conf", + "/usr/lib/sysctl.d/15-lib.conf", "/lib/sysctl.d/20-lib.conf", + "/etc/sysctl.d/50-overriden.conf", "/etc/sysctl.d/70-yast.conf", "/etc/sysctl.conf" + ]) + end + end + + it "does not include ignored configuration files (same name, less precedense location)" do + expect(config.files.map(&:file_path)).to_not include("/etc/system.d/sync_cookies.conf") + end + end + + describe "#forward_ipv4" do + before do + config.load + end + + it "returns the forward_ipv4 value with highest precedence" do + expect(config.forward_ipv4).to eq(true) + end + + context "when the value is not present" do + it "returns the default from the main file" do + expect(config.forward_ipv6).to eq(false) + end + end + end + + describe "#forward_ipv4=" do + before do + config.load + end + + it "changes the value" do + expect { config.forward_ipv4 = false }.to change { config.forward_ipv4 }.from(true).to(false) + end + end + + describe "#conflict_files" do + context "when YaST configuration file is empty" do + it "returns false" do + expect(config.conflict?).to eq(false) + end + end + + context "when YaST configuration file is present" do + before do + config.load + file.tcp_syncookies = tcp_syncookies + end + + let(:file) { config.files.find { |f| f.file_path == CFA::Sysctl::PATH } } + let(:tcp_syncookies) { true } + + context "and no specific attributes are given" do + it "checks all known attributes" do + expect(file).to receive(:present?).exactly(CFA::Sysctl.known_attributes.count).times + config.conflict? + end + end + + context "and specific attributes is given" do + context "attribute will be not found" do + it "returns false" do + expect(config.conflict?(only: [:not_valid])).to eq(false) + end + end + + context "attribute is valid" do + context "when some main file value is overriden" do + let(:tcp_syncookies) { false } + + it "returns true" do + expect(config.conflict?(only: [:tcp_syncookies])) + .to eq(true) + end + end + + context "when no value is overriden" do + let(:tcp_syncookies) { true } + + it "returns false" do + expect(config.conflict?(only: [:tcp_syncookies])) + .to eq(false) + end + end + end + end + + context "when some main file value is overriden" do + let(:tcp_syncookies) { false } + + it "returns true" do + expect(config.conflict?).to eq(true) + end + end + + context "when no value is overriden" do + let(:tcp_syncookies) { true } + + it "returns false" do + expect(config.conflict?).to eq(false) + end + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.2.61/library/general/test/cfa/sysctl_test.rb new/yast2-4.2.67/library/general/test/cfa/sysctl_test.rb --- old/yast2-4.2.61/library/general/test/cfa/sysctl_test.rb 2020-01-29 15:00:05.000000000 +0100 +++ new/yast2-4.2.67/library/general/test/cfa/sysctl_test.rb 2020-02-26 11:31:10.000000000 +0100 @@ -44,6 +44,13 @@ sysctl.load end + describe "#initialize" do + it "creates an own Augeas instance" do + expect(::CFA::AugeasParser).to receive(:new).with("sysctl.lns").and_call_original + CFA::Sysctl.new(file_handler: file_handler) + end + end + describe "#raw_forward_ipv4" do it "returns IPv4 forwarding raw value" do expect(sysctl.raw_forward_ipv4).to eq("1") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.2.61/library/general/test/data/sysctl-full/boot/sysctl.conf-5.3.6-1-default new/yast2-4.2.67/library/general/test/data/sysctl-full/boot/sysctl.conf-5.3.6-1-default --- old/yast2-4.2.61/library/general/test/data/sysctl-full/boot/sysctl.conf-5.3.6-1-default 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-4.2.67/library/general/test/data/sysctl-full/boot/sysctl.conf-5.3.6-1-default 2020-02-26 11:31:10.000000000 +0100 @@ -0,0 +1,16 @@ +# Generated file - do not edit. +# Disable the hung task timer by default. (bnc#552820) +kernel.hung_task_timeout_secs = 0 + +# Increase defaults for IPC (bnc#146656) +kernel.msgmax = 65536 +kernel.msgmnb = 65536 +# Increase defaults for IPC (bnc#146656) (64-bit, 4k pages) +kernel.shmmax = 0xffffffffffffffff +# SHMALL = SHMMAX/PAGE_SIZE*(SHMMNI/16) +kernel.shmall = 0x0fffffffffffff00 +# The desktop workload is sensitive to latency, so start writeout earlier +# (bnc#552883) +vm.dirty_ratio=20 + +kernel.sysrq = 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.2.61/library/general/test/data/sysctl-full/boot/sysctl.conf-5.3.7-1-default new/yast2-4.2.67/library/general/test/data/sysctl-full/boot/sysctl.conf-5.3.7-1-default --- old/yast2-4.2.61/library/general/test/data/sysctl-full/boot/sysctl.conf-5.3.7-1-default 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-4.2.67/library/general/test/data/sysctl-full/boot/sysctl.conf-5.3.7-1-default 2020-02-26 11:31:10.000000000 +0100 @@ -0,0 +1,16 @@ +# Generated file - do not edit. +# Disable the hung task timer by default. (bnc#552820) +kernel.hung_task_timeout_secs = 0 + +# Increase defaults for IPC (bnc#146656) +kernel.msgmax = 65536 +kernel.msgmnb = 65536 +# Increase defaults for IPC (bnc#146656) (64-bit, 4k pages) +kernel.shmmax = 0xffffffffffffffff +# SHMALL = SHMMAX/PAGE_SIZE*(SHMMNI/16) +kernel.shmall = 0x0fffffffffffff00 +# The desktop workload is sensitive to latency, so start writeout earlier +# (bnc#552883) +vm.dirty_ratio=20 + +kernel.sysrq = 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.2.61/library/general/test/data/sysctl-full/etc/sysctl.conf new/yast2-4.2.67/library/general/test/data/sysctl-full/etc/sysctl.conf --- old/yast2-4.2.61/library/general/test/data/sysctl-full/etc/sysctl.conf 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-4.2.67/library/general/test/data/sysctl-full/etc/sysctl.conf 2020-02-26 11:31:10.000000000 +0100 @@ -0,0 +1 @@ +net.ipv4.tcp_syncookies=1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.2.61/library/general/test/data/sysctl-full/etc/sysctl.d/70-yast.conf new/yast2-4.2.67/library/general/test/data/sysctl-full/etc/sysctl.d/70-yast.conf --- old/yast2-4.2.61/library/general/test/data/sysctl-full/etc/sysctl.d/70-yast.conf 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-4.2.67/library/general/test/data/sysctl-full/etc/sysctl.d/70-yast.conf 2020-02-26 11:31:10.000000000 +0100 @@ -0,0 +1 @@ +net.ipv4.ip_forward=1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.2.61/library/general/test/data/sysctl-full/run/sysctl.d/05-syn_cookies.conf new/yast2-4.2.67/library/general/test/data/sysctl-full/run/sysctl.d/05-syn_cookies.conf --- old/yast2-4.2.61/library/general/test/data/sysctl-full/run/sysctl.d/05-syn_cookies.conf 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-4.2.67/library/general/test/data/sysctl-full/run/sysctl.d/05-syn_cookies.conf 2020-02-26 11:31:10.000000000 +0100 @@ -0,0 +1,2 @@ +net.ipv4.tcp_syncookies=1 +net.ipv4.ip_forward=0 \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.2.61/library/gpg/src/modules/GPGWidgets.rb new/yast2-4.2.67/library/gpg/src/modules/GPGWidgets.rb --- old/yast2-4.2.61/library/gpg/src/modules/GPGWidgets.rb 2020-01-29 15:00:05.000000000 +0100 +++ new/yast2-4.2.67/library/gpg/src/modules/GPGWidgets.rb 2020-02-26 11:31:10.000000000 +0100 @@ -203,7 +203,7 @@ "void (string, map)" ), "help" => _( - "<p><big><b>GPG Private Key</b></big><br>\nThe table contains list of the private GPG keys.</p>" + "<p><big><b>GPG Private Key</b></big><br>\nThe table contains a list of private GPG keys.</p>" ) } end @@ -235,7 +235,7 @@ "void (string, map)" ), "help" => _( - "<p><big><b>GPG Public Key</b></big><br>\nThe table contains list of the public GPG keys.</p>" + "<p><big><b>GPG Public Key</b></big><br>\nThe table contains a list of public GPG keys.</p>" ) } end @@ -282,7 +282,7 @@ "handle" => fun_ref(method(:GpgNewKey), "symbol (string, map)"), "help" => _( "<p><big><b>Create a new GPG key</b></big><br>\n" \ - "<tt>gpg --gen-key</tt> is started, see <tt>gpg</tt> manual pager for more information.\n" \ + "<tt>gpg --gen-key</tt> is started, see the <tt>gpg</tt> manual page for more information.\n" \ "Press Ctrl+C to cancel.\n" \ "</p>" ) @@ -327,7 +327,7 @@ ), # help text "help" => _( - "<p><big><b>Passphrase</b></big><br>\nEnter passphrase to unlock the GPG key." + "<p><big><b>Passphrase</b></big><br>\nEnter the passphrase to unlock the GPG key." ) } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.2.61/library/network/src/modules/SuSEFirewallProposal.rb new/yast2-4.2.67/library/network/src/modules/SuSEFirewallProposal.rb --- old/yast2-4.2.61/library/network/src/modules/SuSEFirewallProposal.rb 2020-01-29 15:00:05.000000000 +0100 +++ new/yast2-4.2.67/library/network/src/modules/SuSEFirewallProposal.rb 2020-02-26 11:31:10.000000000 +0100 @@ -539,7 +539,7 @@ # TRANSLATORS: Proposal informative text output = "<ul>" + _( - "SuSEfirewall2 package is not installed, firewall will be disabled." + "The SuSEfirewall2 package is not installed. The firewall will be disabled." ) + "</ul>" return { "output" => output, "warning" => warning } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.2.61/library/packages/src/lib/y2packager/product_control_product.rb new/yast2-4.2.67/library/packages/src/lib/y2packager/product_control_product.rb --- old/yast2-4.2.61/library/packages/src/lib/y2packager/product_control_product.rb 2020-01-29 15:00:05.000000000 +0100 +++ new/yast2-4.2.67/library/packages/src/lib/y2packager/product_control_product.rb 2020-02-26 11:31:10.000000000 +0100 @@ -51,6 +51,13 @@ return @products if @products control_products = Yast::ProductFeatures.GetFeature("software", "base_products") + + if !control_products.is_a?(Array) + log.warn("Invalid or missing 'software/base_products' value: #{control_products.inspect}") + @products = [] + return @products + end + arch = REG_ARCH[Yast::Arch.architecture] || Yast::Arch.architecture linuxrc_products = (Yast::Linuxrc.InstallInf("specialproduct") || "").split(",").map(&:strip) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.2.61/library/packages/test/y2packager/product_control_product_test.rb new/yast2-4.2.67/library/packages/test/y2packager/product_control_product_test.rb --- old/yast2-4.2.61/library/packages/test/y2packager/product_control_product_test.rb 2020-01-29 15:00:05.000000000 +0100 +++ new/yast2-4.2.67/library/packages/test/y2packager/product_control_product_test.rb 2020-02-26 11:31:10.000000000 +0100 @@ -73,6 +73,15 @@ product = Y2Packager::ProductControlProduct.products.first expect(product.register_target).to eq("sle-15-x86_64") end + + it "returns empty list if the control file value is missing" do + # when the value is not found ProductFeatures return empty string! + expect(Yast::ProductFeatures).to receive(:GetFeature) + .with("software", "base_products").and_return("") + + products = Y2Packager::ProductControlProduct.products + expect(products).to be_empty + end end describe ".selected" do diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.2.61/package/yast2.changes new/yast2-4.2.67/package/yast2.changes --- old/yast2-4.2.61/package/yast2.changes 2020-01-29 15:00:05.000000000 +0100 +++ new/yast2-4.2.67/package/yast2.changes 2020-02-26 11:31:10.000000000 +0100 @@ -1,4 +1,50 @@ ------------------------------------------------------------------- +Wed Feb 26 10:42:42 CET 2020 - [email protected] + +- Updated docu for SysctlConfig class (bsc#1151649). + +------------------------------------------------------------------- +Mon Feb 24 15:02:15 CET 2020 - [email protected] + +- Creating an own Augeas instance for each parsed sysctl file + (bsc#1151649). +- 4.2.67 + +------------------------------------------------------------------- +Mon Feb 17 17:59:07 UTC 2020 - [email protected] + +- SysctlConfig class: Handle sysctl entries in different + directories (bsc#1151649). +- 4.2.66 + +------------------------------------------------------------------- +Mon Feb 17 16:59:07 UTC 2020 - Stefan Hundhammer <[email protected]> + +- Fixed user-visible messages (bsc#1084015) +- 4.2.65 + +------------------------------------------------------------------- +Tue Feb 4 14:15:37 UTC 2020 - Josef Reidinger <[email protected]> + +- Show on WSL only WSL capable modules in control center + (bsc#1162650) +- 4.2.64 + +------------------------------------------------------------------- +Fri Jan 31 16:07:35 UTC 2020 - José Iván López González <[email protected]> + +- Add new widgets CWM::ProgressBar and CWM::DynamicProgressBar. +- Needed for bsc#1135366. +- 4.2.63 + +------------------------------------------------------------------- +Thu Jan 30 11:19:00 UTC 2020 - Ladislav Slezák <[email protected]> + +- Do not crash when the "software/base_products" is not defined + in the control.xml (bsc#1161956) +- 4.2.62 + +------------------------------------------------------------------- Wed Jan 29 13:22:50 UTC 2020 - Josef Reidinger <[email protected]> - Speed up run on WSL (bsc#1157575) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.2.61/package/yast2.spec new/yast2-4.2.67/package/yast2.spec --- old/yast2-4.2.61/package/yast2.spec 2020-01-29 15:00:05.000000000 +0100 +++ new/yast2-4.2.67/package/yast2.spec 2020-02-26 11:31:10.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2 -Version: 4.2.61 +Version: 4.2.67 Release: 0 Summary: YaST2 Main Package License: GPL-2.0-only
