Hello community, here is the log from the commit of package yast2 for openSUSE:Factory checked in at 2019-01-24 14:00:55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2 (Old) and /work/SRC/openSUSE:Factory/.yast2.new.28833 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2" Thu Jan 24 14:00:55 2019 rev:441 rq:667692 version:4.1.53 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2/yast2.changes 2019-01-10 15:16:01.646765339 +0100 +++ /work/SRC/openSUSE:Factory/.yast2.new.28833/yast2.changes 2019-01-24 14:00:59.108217751 +0100 @@ -1,0 +2,36 @@ +Thu Jan 17 00:55:03 UTC 2019 - knut.anders...@suse.com + +- CWM: Added date field and time field widgets (fate#322722) +- 4.1.53 + +------------------------------------------------------------------- +Wed Jan 16 16:52:19 CET 2019 - sch...@suse.de + +- Support special products which will be enabled via linuxrc + (flag "specialproduct") (fate#327099) +- 4.1.52 + +------------------------------------------------------------------- +Wed Jan 16 13:03:59 UTC 2019 - jreidin...@suse.com + +- Firewall: drop not needed relations and its related methods +- Firewall: move export method to yast2-firewall (fate#324662) +- 4.1.51 + +------------------------------------------------------------------- +Mon Jan 14 10:55:20 UTC 2019 - Josef Reidinger <jreidin...@suse.com> + +- CWM: Add method focus to object CWM widgets (FATE#324662) +- CWM: Add rspec helper for common CWM widgets +- CWM: Allow CWM dialogs/popups to have own help +- CWM: Fix showing help for CWM Popup (FATE#324662) +- 4.1.50 + +------------------------------------------------------------------- +Thu Jan 10 14:45:03 UTC 2019 - Josef Reidinger <jreidin...@suse.com> + +- Fix crashes of many modules when invoking from ncurses control + center (bsc#1121425) +- 4.1.49 + +------------------------------------------------------------------- Old: ---- yast2-4.1.48.tar.bz2 New: ---- yast2-4.1.53.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2.spec ++++++ --- /var/tmp/diff_new_pack.u97x3q/_old 2019-01-24 14:00:59.792216971 +0100 +++ /var/tmp/diff_new_pack.u97x3q/_new 2019-01-24 14:00:59.796216967 +0100 @@ -17,7 +17,7 @@ Name: yast2 -Version: 4.1.48 +Version: 4.1.53 Release: 0 Summary: YaST2 - Main Package License: GPL-2.0-only @@ -95,6 +95,8 @@ Conflicts: yast2-dns-server < 3.1.17 # InstError Conflicts: yast2-installation < 2.18.5 +# moved export method +Conflicts: yast2-installation < 4.1.8 # moved cfg_mail.scr Conflicts: yast2-mail < 3.1.7 # Older packager use removed API ++++++ yast2-4.1.48.tar.bz2 -> yast2-4.1.53.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.1.48/library/cwm/examples/date_time.rb new/yast2-4.1.53/library/cwm/examples/date_time.rb --- old/yast2-4.1.48/library/cwm/examples/date_time.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-4.1.53/library/cwm/examples/date_time.rb 2019-01-18 09:50:21.000000000 +0100 @@ -0,0 +1,69 @@ +# Simple example to demonstrate object API for CWM + +require_relative "example_helper" + +require "cwm" +require "cwm/popup" + +Yast.import "CWM" + +class Name < CWM::InputField + def initialize + textdomain "example" + end + + def label + _("Name") + end +end + +class EventDate < CWM::DateField + def initialize + textdomain "example" + end + + def init + self.value = Time.now.strftime("%Y-%m-%d") + end + + def label + _("Event date") + end +end + +class EventTime < CWM::TimeField + def initialize + textdomain "example" + end + + def init + self.value = Time.now.strftime("%H:%M:%S") + end + + def label + _("Event time") + end +end + +class Event < ::CWM::Popup + def initialize + textdomain "example" + end + + def contents + VBox( + Name.new, + HBox( + EventDate.new, + HSpacing(1), + EventTime.new + ) + ) + end + + def title + _("Event Example") + end +end + +Event.new.run diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.1.48/library/cwm/examples/popup.rb new/yast2-4.1.53/library/cwm/examples/popup.rb --- old/yast2-4.1.48/library/cwm/examples/popup.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-4.1.53/library/cwm/examples/popup.rb 2019-01-18 09:50:21.000000000 +0100 @@ -0,0 +1,74 @@ +# Simple example to demonstrate object API for CWM + +require_relative "example_helper" + +require "cwm" +require "cwm/popup" + +Yast.import "CWM" + +class Goat < CWM::CheckBox + def initialize + textdomain "example" + end + + def label + _("Goat") + end + + def help + _("<p>Goat will eat cabbage.</p>") + end +end + +class Cabbage < CWM::CheckBox + def initialize + textdomain "example" + end + + def label + _("Cabbage") + end + + def help + _("<p>Poor cabbage cannot eat anyone.</p>") + end +end + +class Wolf < CWM::CheckBox + def initialize + textdomain "example" + end + + def label + _("Wolf") + end + + def help + _("<p>Wolf hates vegans, so will eat goat and won't even touch cabbage.</p>") + end +end + +class Ferryman < ::CWM::Popup + def initialize + textdomain "example" + end + + def contents + HBox( + Cabbage.new, + Goat.new, + Wolf.new + ) + end + + def help + _("<h3>Ferryman</h3><p>Represents common Ferryman challenge with two place in boat and following rules for passengers:</p>") + end + + def title + _("Ferryman") + end +end + +Ferryman.new.run diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.1.48/library/cwm/src/lib/cwm/abstract_widget.rb new/yast2-4.1.53/library/cwm/src/lib/cwm/abstract_widget.rb --- old/yast2-4.1.48/library/cwm/src/lib/cwm/abstract_widget.rb 2019-01-07 11:39:08.000000000 +0100 +++ new/yast2-4.1.53/library/cwm/src/lib/cwm/abstract_widget.rb 2019-01-18 09:50:21.000000000 +0100 @@ -1,6 +1,8 @@ require "abstract_method" require "yast" +Yast.import "UI" + module CWM # A Yast::Term that can be passed as is to Yast::UI methods # (OpenDialog, ReplaceWidget) @@ -183,6 +185,11 @@ Yast::UI.ChangeWidget(Id(widget_id), :Enabled, false) end + # Focus the widget. Useful when validation failed to highlight it. + def focus + Yast::UI.SetFocus(Id(widget_id)) + end + protected # A helper to check if an event is invoked by this widget diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.1.48/library/cwm/src/lib/cwm/common_widgets.rb new/yast2-4.1.53/library/cwm/src/lib/cwm/common_widgets.rb --- old/yast2-4.1.48/library/cwm/src/lib/cwm/common_widgets.rb 2019-01-07 11:39:08.000000000 +0100 +++ new/yast2-4.1.53/library/cwm/src/lib/cwm/common_widgets.rb 2019-01-18 09:50:21.000000000 +0100 @@ -366,4 +366,22 @@ include ValueBasedWidget end + + # Time field widget + # The {#label} method is mandatory. + class TimeField < AbstractWidget + self.widget_type = :time_field + + include ValueBasedWidget + abstract_method :label + end + + # Date field widget + # The {#label} method is mandatory. + class DateField < AbstractWidget + self.widget_type = :date_field + + include ValueBasedWidget + abstract_method :label + end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.1.48/library/cwm/src/lib/cwm/dialog.rb new/yast2-4.1.53/library/cwm/src/lib/cwm/dialog.rb --- old/yast2-4.1.48/library/cwm/src/lib/cwm/dialog.rb 2019-01-07 11:39:08.000000000 +0100 +++ new/yast2-4.1.53/library/cwm/src/lib/cwm/dialog.rb 2019-01-18 09:50:21.000000000 +0100 @@ -1,5 +1,6 @@ require "yast" require "abstract_method" +require "cwm/common_widgets" Yast.import "CWM" Yast.import "Wizard" @@ -8,6 +9,7 @@ # An OOP API and the pieces missing from {Yast::CWMClass#show Yast::CWM.show}: # - creating and closing a wizard dialog # - Back/Abort/Next buttons + # - Help introduction for dialog # # @see UI::Dialog # @see CWM::AbstractWidget @@ -103,8 +105,33 @@ true end + # Introduction for help. This help text will be displayed before widget specific help. + # Default implementation is empty. If dialog want its help it need to + # overwrite the method with own text. + # @note text should be marked for translation + # @return [String] help text with rich text formatting + def help + "" + end + private + # Empty widget which is first on the page and contain help for whole dialog + class FakeHelp < Empty + def initialize(text) + @text = text + end + + def init + Yast::CWM.ReplaceWidgetHelp # needed for popup to properly set help text outside wizard + log.info "calling init on fake help" + end + + def help + @text + end + end + # Create a wizard dialog, run the *block*, ensure the dialog is closed. # @param block def wizard_create_dialog(&block) @@ -118,7 +145,7 @@ # @return [Symbol] wizard sequencer symbol def cwm_show Yast::CWM.show( - contents, + Yast::Term.new(:HBox, FakeHelp.new(help), contents), caption: title, back_button: back_button, abort_button: abort_button, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.1.48/library/cwm/src/lib/cwm/popup.rb new/yast2-4.1.53/library/cwm/src/lib/cwm/popup.rb --- old/yast2-4.1.48/library/cwm/src/lib/cwm/popup.rb 2019-01-07 11:39:08.000000000 +0100 +++ new/yast2-4.1.53/library/cwm/src/lib/cwm/popup.rb 2019-01-18 09:50:21.000000000 +0100 @@ -20,10 +20,13 @@ # find current contact information at www.suse.com. require "cwm/dialog" +Yast.import "Popup" + module CWM # CWM pop-up dialog # # This class offers a CWM dialog which behaves as a pop-up. + # @see {CWM::Dialog} for remaining configuration options. class Popup < Dialog # Determines that a dialog should always be open # @@ -34,6 +37,12 @@ true end + # Popup does not allow nil, so overwrite Dialog default value. + # @return [String] The dialog title. + def title + "" + end + private # Redefines the mechanism to open the dialog to use the adapted layout @@ -52,6 +61,7 @@ # @return [Yast::Term] def layout VBox( + Id(:WizardDialog), HSpacing(50), Left(Heading(Id(:title), title)), VStretch(), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.1.48/library/cwm/src/lib/cwm/rspec.rb new/yast2-4.1.53/library/cwm/src/lib/cwm/rspec.rb --- old/yast2-4.1.48/library/cwm/src/lib/cwm/rspec.rb 2019-01-07 11:39:08.000000000 +0100 +++ new/yast2-4.1.53/library/cwm/src/lib/cwm/rspec.rb 2019-01-18 09:50:21.000000000 +0100 @@ -89,6 +89,16 @@ include_examples "CWM::ItemsSelection" end +RSpec.shared_examples "CWM::SelectionBox" do + include_examples "CWM::AbstractWidget" + include_examples "CWM::ItemsSelection" +end + +RSpec.shared_examples "CWM::MultiSelectionBox" do + include_examples "CWM::AbstractWidget" + include_examples "CWM::ItemsSelection" +end + RSpec.shared_examples "CWM::PushButton" do include_examples "CWM::AbstractWidget" end @@ -127,6 +137,31 @@ include_examples "CWM::AbstractWidget" include_examples "CWM::ValueBasedWidget" end + +RSpec.shared_examples "CWM::InputField" do + include_examples "CWM::AbstractWidget" + include_examples "CWM::ValueBasedWidget" +end + +RSpec.shared_examples "CWM::Password" do + include_examples "CWM::AbstractWidget" + include_examples "CWM::ValueBasedWidget" +end + +RSpec.shared_examples "CWM::IntField" do + include_examples "CWM::AbstractWidget" + include_examples "CWM::ValueBasedWidget" +end + +RSpec.shared_examples "CWM::DateField" do + include_examples "CWM::AbstractWidget" + include_examples "CWM::ValueBasedWidget" +end + +RSpec.shared_examples "CWM::TimeField" do + include_examples "CWM::AbstractWidget" + include_examples "CWM::ValueBasedWidget" +end RSpec.shared_examples "CWM::Table" do include_examples "CWM::AbstractWidget" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.1.48/library/cwm/src/modules/CWM.rb new/yast2-4.1.53/library/cwm/src/modules/CWM.rb --- old/yast2-4.1.48/library/cwm/src/modules/CWM.rb 2019-01-07 11:39:08.000000000 +0100 +++ new/yast2-4.1.53/library/cwm/src/modules/CWM.rb 2019-01-18 09:50:21.000000000 +0100 @@ -616,6 +616,10 @@ Ops.set(w, "widget", MultiLineEdit(id_term, opt_term, label)) elsif widget == :richtext Ops.set(w, "widget", RichText(id_term, opt_term, "")) + elsif widget == :date_field + Ops.set(w, "widget", DateField(id_term, opt_term, label)) + elsif widget == :time_field + Ops.set(w, "widget", TimeField(id_term, opt_term, label)) end end Ops.set(w, "custom_widget", nil) # not needed any more diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.1.48/library/cwm/test/abstract_widget_test.rb new/yast2-4.1.53/library/cwm/test/abstract_widget_test.rb --- old/yast2-4.1.48/library/cwm/test/abstract_widget_test.rb 2019-01-07 11:39:08.000000000 +0100 +++ new/yast2-4.1.53/library/cwm/test/abstract_widget_test.rb 2019-01-18 09:50:21.000000000 +0100 @@ -5,6 +5,8 @@ require "cwm/abstract_widget" require "cwm/rspec" +Yast.import "UI" + describe CWM::AbstractWidget do include_examples "CWM::AbstractWidget" @@ -190,4 +192,20 @@ expect(TCleanup.new.cwm_definition).to be_key("cleanup") end end + + describe "#focus" do + class TFocus < CWM::AbstractWidget + self.widget_type = :empty + + def initialize + self.widget_id = "test" + end + end + + it "sets focus on given widget" do + expect(Yast::UI).to receive(:SetFocus).with(Id("test")) + + TFocus.new.focus + end + end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.1.48/library/desktop/src/clients/menu.rb new/yast2-4.1.53/library/desktop/src/clients/menu.rb --- old/yast2-4.1.48/library/desktop/src/clients/menu.rb 2019-01-07 11:39:08.000000000 +0100 +++ new/yast2-4.1.53/library/desktop/src/clients/menu.rb 2019-01-18 09:50:21.000000000 +0100 @@ -295,12 +295,16 @@ cmd = "" ret = nil + # prevent shell injection when passing argument. But on other hand do + # not pass empty argument which makes module think it is CLI (bsc#1121425) + argument = argument.empty? ? "" : argument.shellescape + # Use UI::RunInTerminal in text-mode only (#237332) if textmode - cmd = Builtins.sformat("/sbin/yast %1 %2 >&2", function.shellescape, argument.shellescape) + cmd = Builtins.sformat("/sbin/yast %1 %2 >&2", function.shellescape, argument) ret = UI.RunInTerminal(cmd) else - cmd = Builtins.sformat("/sbin/yast2 %1 %2 >&2", function.shellescape, argument.shellescape) + cmd = Builtins.sformat("/sbin/yast2 %1 %2 >&2", function.shellescape, argument) ret = SCR.Execute(path(".target.bash"), cmd) end Builtins.y2milestone("Got %1 from %2", ret, cmd) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.1.48/library/network/src/lib/y2firewall/firewalld/api/zones.rb new/yast2-4.1.53/library/network/src/lib/y2firewall/firewalld/api/zones.rb --- old/yast2-4.1.48/library/network/src/lib/y2firewall/firewalld/api/zones.rb 2019-01-07 11:39:08.000000000 +0100 +++ new/yast2-4.1.53/library/network/src/lib/y2firewall/firewalld/api/zones.rb 2019-01-18 09:50:21.000000000 +0100 @@ -84,38 +84,6 @@ # @param zone [String] The firewall zone # @param permanent [Boolean] if true and firewalld is running it # reads the permanent configuration - # @return [Array<String>] list of zone's sources - def list_sources(zone, permanent: permanent?) - string_command("--zone=#{zone}", "--list-sources", permanent: permanent).split(" ") - end - - # @param zone [String] The firewall zone - # @param permanent [Boolean] if true and firewalld is running it - # reads the permanent configuration - # @return [Array<String>] list of zone's source ports - def list_source_ports(zone, permanent: permanent?) - string_command("--zone=#{zone}", "--list-source-ports", permanent: permanent).split(" ") - end - - # @param zone [String] The firewall zone - # @param permanent [Boolean] if true and firewalld is running it - # reads the permanent configuration - # @return [Array<String>] list of zone's forward ports - def list_forward_ports(zone, permanent: permanent?) - string_command("--zone=#{zone}", "--list-forward-ports", permanent: permanent).split("\n") - end - - # @param zone [String] The firewall zone - # @param permanent [Boolean] if true and firewalld is running it - # reads the permanent configuration - # @return [Array<String>] list of zone's rich rules - def list_rich_rules(zone, permanent: permanent?) - string_command("--zone=#{zone}", "--list-rich-rules", permanent: permanent).split("\n") - end - - # @param zone [String] The firewall zone - # @param permanent [Boolean] if true and firewalld is running it - # reads the permanent configuration # @return [Array<String>] list of all information for given zone def list_all(zone, permanent: permanent?, verbose: false) args = ["--zone=#{zone}", "--list-all"] @@ -185,92 +153,6 @@ end # @param zone [String] The firewall zone - # @param source [String] The network source - # @param permanent [Boolean] if true and firewalld is running it - # modifies the permanent configuration - # @return [Boolean] True if source was added - def add_source(zone, source, permanent: permanent?) - modify_command("--zone=#{zone}", "--add-source=#{source}", permanent: permanent) - end - - # @param zone [String] The firewall zone - # @param source [String] The network source - # @param permanent [Boolean] if true and firewalld is running it - # modifies the permanent configuration - # @return [Boolean] True if source was removed - def remove_source(zone, source, permanent: permanent?) - modify_command("--zone=#{zone}", "--remove-source=#{source}", - permanent: permanent) - end - - # @param zone [String] The firewall zone - # @param source [String] The network source - # @param permanent [Boolean] if true and firewalld is running it - # modifies the permanent configuration - # @return [Boolean] True if source was changed - def change_source(zone, source, permanent: permanent?) - modify_command("--zone=#{zone}", "--change-source=#{source}", permanent: permanent) - end - - # @param zone [String] The firewall zone - # @param port [String] The network source port - # @param permanent [Boolean] if true and firewalld is running it - # modifies the permanent configuration - # @return [Boolean] True if the port was added - def add_source_port(zone, port, permanent: permanent?) - modify_command("--zone=#{zone}", "--add-source-port=#{port}", permanent: permanent) - end - - # @param zone [String] The firewall zone - # @param port [String] The network source port - # @param permanent [Boolean] if true and firewalld is running it - # modifies the permanent configuration - # @return [Boolean] True if the port was removed - def remove_source_port(zone, port, permanent: permanent?) - modify_command("--zone=#{zone}", "--remove-source-port=#{port}", permanent: permanent) - end - - # @param zone [String] The firewall zone - # @param port [String] The network forward port - # @param permanent [Boolean] if true and firewalld is running it - # modifies the permanent configuration - # @return [Boolean] True if the port was added - def add_forward_port(zone, port, permanent: permanent?) - modify_command("--zone=#{zone}", "--add-forward-port=#{port}", - permanent: permanent) - end - - # @param zone [String] The firewall zone - # @param port [String] The network source port - # @param permanent [Boolean] if true and firewalld is running it - # modifies the permanent configuration - # @return [Boolean] True if the port was removed - def remove_forward_port(zone, port, permanent: permanent?) - modify_command("--zone=#{zone}", "--remove-forward-port=#{port}", - permanent: permanent) - end - - # @param zone [String] The firewall zone - # @param rule [String] The firewalld rule to be added - # @param permanent [Boolean] if true and firewalld is running it - # modifies the permanent configuration - # @return [Boolean] True if the rich rule was added - def add_rich_rule(zone, rule, permanent: permanent?) - modify_command("--zone=#{zone}", "--add-rich-rule=#{rule}", - permanent: permanent) - end - - # @param zone [String] The firewall zone - # @param rule [String] The firewalld rich rule to be removed - # @param permanent [Boolean] if true and firewalld is running it - # modifies the permanent configuration - # @return [Boolean] True if the rich rule was removed - def remove_rich_rule(zone, rule, permanent: permanent?) - modify_command("--zone=#{zone}", "--remove-rich-rule=#{rule}", - permanent: permanent) - end - - # @param zone [String] The firewall zone # @param service [String] The firewall service # @return [Boolean] True if service is enabled in zone def service_enabled?(zone, service, permanent: permanent?) @@ -292,13 +174,6 @@ end # @param zone [String] The firewall zone - # @param source [String] The network source - # @return [Boolean] True if the source is binded to the zone - def source_enabled?(zone, source, permanent: permanent?) - query_command("--zone=#{zone}", "--query-source=#{source}", permanent: permanent) - end - - # @param zone [String] The firewall zone # @param service [String] The firewall service # @param permanent [Boolean] if true and firewalld is running it # modifies the permanent configuration diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.1.48/library/network/src/lib/y2firewall/firewalld/zone.rb new/yast2-4.1.53/library/network/src/lib/y2firewall/firewalld/zone.rb --- old/yast2-4.1.48/library/network/src/lib/y2firewall/firewalld/zone.rb 2019-01-07 11:39:08.000000000 +0100 +++ new/yast2-4.1.53/library/network/src/lib/y2firewall/firewalld/zone.rb 2019-01-18 09:50:21.000000000 +0100 @@ -48,8 +48,9 @@ }.freeze # @see Y2Firewall::Firewalld::Relations - has_many :services, :interfaces, :protocols, :rich_rules, :sources, - :ports, :source_ports, :forward_ports, cache: true + # @note relations are experted to autoyast, so do not forget when modify to adapt + # schema and also autoyast importer + has_many :services, :interfaces, :protocols, :ports, cache: true # @see Y2Firewall::Firewalld::Relations has_attributes :name, :masquerade, :short, :description, :target, cache: true @@ -127,16 +128,6 @@ services.include?(service) end - # Dump a hash with the zone configuration - # - # @return [Hash] zone configuration - def export - (attributes + relations) - .each_with_object({}) do |field, profile| - profile[field.to_s] = public_send(field) unless public_send(field).nil? - end - end - # Override relation method to be more defensive. An interface can only # belong to one zone and the change method remove it before add. # @@ -145,14 +136,6 @@ api.change_interface(name, interface) end - # Override relation method to be more defensive. A source can only belong - # to one zone and the change method remove it before add. - # - # @param source [String] source address - def add_source!(source) - api.change_source(name, source) - end - private # Convenience method which return an instance of Y2Firewall::Firewalld diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.1.48/library/network/src/lib/y2firewall/firewalld/zone_reader.rb new/yast2-4.1.53/library/network/src/lib/y2firewall/firewalld/zone_reader.rb --- old/yast2-4.1.48/library/network/src/lib/y2firewall/firewalld/zone_reader.rb 2019-01-07 11:39:08.000000000 +0100 +++ new/yast2-4.1.53/library/network/src/lib/y2firewall/firewalld/zone_reader.rb 2019-01-18 09:50:21.000000000 +0100 @@ -39,7 +39,6 @@ attr_accessor :zones_definition BOOLEAN_ATTRIBUTES = ["icmp-block-inversion", "masquerade"].freeze - MULTIPLE_ENTRIES = ["rich_rules", "forward_ports"].freeze # Constructor # @@ -96,7 +95,7 @@ zone_names.include?(attribute) ? attribute : nil end - ATTRIBUTE_MAPPING = { "summary" => "short", "rich rules" => "rich_rules" }.freeze + ATTRIBUTE_MAPPING = { "summary" => "short" }.freeze # Iterates over the zone entries instantiating a zone object per each of # the entries and returning an array with all of them. # @@ -111,12 +110,10 @@ attribute = ATTRIBUTE_MAPPING[attribute] if ATTRIBUTE_MAPPING[attribute] next unless zone.respond_to?("#{attribute}=") - value = MULTIPLE_ENTRIES.include?(attribute) ? entries.reject(&:empty?) : entries.first.to_s + value = entries.first.to_s if BOOLEAN_ATTRIBUTES.include?(attribute) zone.public_send("#{attribute}=", value == "yes" ? true : false) - elsif MULTIPLE_ENTRIES.include?(attribute) - zone.public_send("#{attribute}=", value) elsif zone.attributes.include?(attribute.to_sym) zone.public_send("#{attribute}=", value) else diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.1.48/library/network/src/lib/y2firewall/firewalld.rb new/yast2-4.1.53/library/network/src/lib/y2firewall/firewalld.rb --- old/yast2-4.1.48/library/network/src/lib/y2firewall/firewalld.rb 2019-01-07 11:39:08.000000000 +0100 +++ new/yast2-4.1.53/library/network/src/lib/y2firewall/firewalld.rb 2019-01-18 09:50:21.000000000 +0100 @@ -192,20 +192,6 @@ end end - # Return a map with current firewalld settings. - # - # @return [Hash] dump firewalld settings - def export - return {} unless installed? - { - "enable_firewall" => enabled?, - "start_firewall" => running?, - "default_zone" => default_zone, - "log_denied_packets" => log_denied_packets, - "zones" => zones.map(&:export) - } - end - # Return whether the firewalld package is installed or not # # @return [Boolean] true if it is installed; false otherwise diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.1.48/library/network/test/y2firewall/firewalld/api/zones_test.rb new/yast2-4.1.53/library/network/test/y2firewall/firewalld/api/zones_test.rb --- old/yast2-4.1.48/library/network/test/y2firewall/firewalld/api/zones_test.rb 2019-01-07 11:39:08.000000000 +0100 +++ new/yast2-4.1.53/library/network/test/y2firewall/firewalld/api/zones_test.rb 2019-01-18 09:50:21.000000000 +0100 @@ -156,34 +156,6 @@ end end - describe "#list_sources" do - it "returns the list of sources binded to the zone" do - allow(api).to receive(:string_command) - .with("--zone=test", "--list-sources", permanent: api.permanent?) - .and_return("192.168.5.0/24") - - expect(api.list_sources("test")).to eql(["192.168.5.0/24"]) - end - end - - describe "#add_source" do - it "binds the given source with the zone" do - expect(api).to receive(:modify_command) - .with("--zone=test", "--add-source=192.168.4.0/24", permanent: api.permanent?) - - api.add_source("test", "192.168.4.0/24") - end - end - - describe "#remove_source" do - it "unbinds the given source from the zone" do - expect(api).to receive(:modify_command) - .with("--zone=test", "--remove-source=192.168.4.0/24", permanent: api.permanent?) - - api.remove_source("test", "192.168.4.0/24") - end - end - describe "#add_service" do it "adds the given service to the specified zone" do expect(api).to receive(:modify_command) @@ -207,22 +179,6 @@ end end - describe "#source_enabled?" do - it "returns false if the source is not binded to the zone" do - allow(api).to receive(:query_command) - .with("--zone=public", "--query-source=192.168.4.0/24", permanent: api.permanent?) - .and_return(false) - expect(subject.source_enabled?("public", "192.168.4.0/24")).to eql(false) - end - - it "returns true if the souce is binded by the zone" do - allow(api).to receive(:query_command) - .with("--zone=public", "--query-source=192.168.4.0/24", permanent: api.permanent?) - .and_return(true) - expect(subject.source_enabled?("public", "192.168.4.0/24")).to eql(true) - end - end - describe "#interface_zone" do it "returns the name of the zone the interface belongs to" do allow(api).to receive(:string_command) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.1.48/library/network/test/y2firewall/firewalld/zone_reader_test.rb new/yast2-4.1.53/library/network/test/y2firewall/firewalld/zone_reader_test.rb --- old/yast2-4.1.48/library/network/test/y2firewall/firewalld/zone_reader_test.rb 2019-01-07 11:39:08.000000000 +0100 +++ new/yast2-4.1.53/library/network/test/y2firewall/firewalld/zone_reader_test.rb 2019-01-18 09:50:21.000000000 +0100 @@ -95,13 +95,6 @@ expect(public_zone.interfaces).to eq(["eth0", "ens3"]) expect(public_zone.ports).to include("123/udp", "530/udp") expect(public_zone.masquerade).to eq(true) - expect(public_zone.sources).to eq(["192.168.0.0/24", "192.168.1.0/24", "192.168.2.0/24"]) - expect(public_zone.rich_rules) - .to eq([ - "rule service name=\"http\" accept", - "rule service name=\"https\" accept", - "rule service name=\"ssh\" accept" - ]) dmz_zone = zones.find { |z| z.name == "dmz" } expect(dmz_zone.masquerade).to eq(false) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.1.48/library/network/test/y2firewall/firewalld/zone_test.rb new/yast2-4.1.53/library/network/test/y2firewall/firewalld/zone_test.rb --- old/yast2-4.1.48/library/network/test/y2firewall/firewalld/zone_test.rb 2019-01-07 11:39:08.000000000 +0100 +++ new/yast2-4.1.53/library/network/test/y2firewall/firewalld/zone_test.rb 2019-01-18 09:50:21.000000000 +0100 @@ -93,31 +93,6 @@ end end - describe "#export" do - subject { described_class.new(name: "test") } - - before do - allow(subject).to receive(:interfaces).and_return(["eth0", "eth1"]) - allow(subject).to receive(:services).and_return(["ssh", "samba"]) - allow(subject).to receive(:ports).and_return(["80/tcp", "443/tcp"]) - allow(subject).to receive(:protocols).and_return(["esp"]) - allow(subject).to receive(:sources).and_return([]) - allow(subject).to receive(:masquerade).and_return(true) - end - - it "dumps a hash with the zone configuration" do - config = subject.export - - expect(config).to be_a(Hash) - expect(config["interfaces"]).to eql(["eth0", "eth1"]) - expect(config["services"]).to eql(["ssh", "samba"]) - expect(config["ports"]).to eql(["80/tcp", "443/tcp"]) - expect(config["protocols"]).to eql(["esp"]) - expect(config["sources"]).to eql([]) - expect(config["masquerade"]).to eql(true) - end - end - describe "#untouched!" do subject { described_class.new(name: "test") } @@ -140,16 +115,6 @@ end end - describe "#add_source!" do - subject { described_class.new(name: "test") } - - it "calls the API changing the specified source to this zone" do - expect(api).to receive(:change_source).with("test", "192.168.1.0/24") - - subject.add_source!("192.168.1.0/24") - end - end - describe "#service_open?" do it "returns whether the service is allowed or not in the zone" do allow(subject).to receive(:services).and_return(["ssh", "vnc"]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.1.48/library/network/test/y2firewall/firewalld_test.rb new/yast2-4.1.53/library/network/test/y2firewall/firewalld_test.rb --- old/yast2-4.1.48/library/network/test/y2firewall/firewalld_test.rb 2019-01-07 11:39:08.000000000 +0100 +++ new/yast2-4.1.53/library/network/test/y2firewall/firewalld_test.rb 2019-01-18 09:50:21.000000000 +0100 @@ -397,53 +397,4 @@ firewalld.write end end - - describe "#export" do - let(:zones_definition) do - ["dmz", - " target: default", - " interfaces: ", - " ports: ", - " protocols:", - " sources:", - "", - "external (active)", - " target: default", - " interfaces: eth0", - " services: ssh samba", - " ports: 5901/tcp 5901/udp", - " protocols: esp", - " sources:"] - end - - let(:api) do - instance_double(Y2Firewall::Firewalld::Api, - log_denied_packets: "all", - default_zone: "work", - list_all_zones: zones_definition, - zones: known_zones, - services: known_services) - end - - before do - allow(firewalld).to receive("api").and_return api - allow(firewalld).to receive("running?").and_return true - allow(firewalld).to receive("enabled?").and_return false - firewalld.read - end - - it "returns a hash with the current firewalld config" do - config = firewalld.export - external = config["zones"].find { |z| z["name"] == "external" } - - expect(config).to be_a(Hash) - expect(config["enable_firewall"]).to eq(false) - expect(config["start_firewall"]).to eq(true) - expect(config["log_denied_packets"]).to eq("all") - expect(config["default_zone"]).to eq("work") - expect(external["interfaces"]).to eq(["eth0"]) - expect(external["ports"]).to eq(["5901/tcp", "5901/udp"]) - expect(external["protocols"]).to eq(["esp"]) - end - end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.1.48/library/packages/src/lib/y2packager/product_reader.rb new/yast2-4.1.53/library/packages/src/lib/y2packager/product_reader.rb --- old/yast2-4.1.48/library/packages/src/lib/y2packager/product_reader.rb 2019-01-07 11:39:08.000000000 +0100 +++ new/yast2-4.1.53/library/packages/src/lib/y2packager/product_reader.rb 2019-01-18 09:50:21.000000000 +0100 @@ -15,6 +15,7 @@ require "y2packager/product_sorter" Yast.import "Pkg" +Yast.import "Linuxrc" module Y2Packager # Read the product information from libzypp @@ -65,15 +66,30 @@ # # @return [Array<Product>] Available products def all_products - @all_products ||= available_products.map do |prod| + linuxrc_special_products = if Yast::Linuxrc.InstallInf("specialproduct") + Yast::Linuxrc.InstallInf("specialproduct").split(",") + else + [] + end + + @all_products ||= available_products.each_with_object([]) do |prod, all_products| prod_pkg = product_package(prod["product_package"]) if prod_pkg + # remove special products if they have not been defined in linuxrc + prod_pkg["deps"].find { |dep| dep["provides"] =~ /\Aspecialproduct\(\s*(.*?)\s*\)\z/ } + special_product_tag = Regexp.last_match[1] if Regexp.last_match + if special_product_tag && !linuxrc_special_products.include?(special_product_tag) + log.info "Special product #{prod["name"]} has not been defined via linuxrc. --> do not offer it" + next + end + + # Evaluating display order prod_pkg["deps"].find { |dep| dep["provides"] =~ /\Adisplayorder\(\s*([0-9]+)\s*\)\z/ } displayorder = Regexp.last_match[1].to_i if Regexp.last_match end - Y2Packager::Product.new( + all_products << Y2Packager::Product.new( name: prod["name"], short_name: prod["short_name"], display_name: prod["display_name"], version: prod["version"], arch: prod["arch"], category: prod["category"], vendor: prod["vendor"], order: displayorder, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.1.48/library/packages/test/y2packager/product_reader_test.rb new/yast2-4.1.53/library/packages/test/y2packager/product_reader_test.rb --- old/yast2-4.1.48/library/packages/test/y2packager/product_reader_test.rb 2019-01-07 11:39:08.000000000 +0100 +++ new/yast2-4.1.53/library/packages/test/y2packager/product_reader_test.rb 2019-01-18 09:50:21.000000000 +0100 @@ -104,16 +104,38 @@ end end - describe "#products" do + describe "#all_products" do + let(:special_prod) do + # reuse the available SLES15 product, just change some attributes + special = products.first.dup + special["name"] = "SLES_BCL" + special["status"] = :available + special["product_package"] = "SLES_BCL-release" + special["display_name"] = "SUSE Linux Enterprise Server 15 Business Critical Linux" + special["short_name"] = "SLE-15-BCL" + special + end + before do allow(Yast::Pkg).to receive(:ResolvableProperties).with("", :product, "") - .and_return(products) + .and_return(products + [special_prod]) allow(Yast::Pkg).to receive(:PkgQueryProvides).with("system-installation()") .and_return([]) + allow(subject).to receive(:product_package).with("sles-release") + .and_return(nil) + allow(subject).to receive(:product_package).with("SLES_BCL-release") + .and_return("deps" => [{ "conflicts"=>"kernel < 4.4" }, + { "provides"=>"specialproduct(SLES_BCL)" }]) end - it "returns available products" do + it "returns available products without special products" do + allow(Yast::Linuxrc).to receive(:InstallInf).with("specialproduct").and_return(nil) expect(subject.all_products.size).to eq(1) end + + it "returns available products with special product" do + allow(Yast::Linuxrc).to receive(:InstallInf).with("specialproduct").and_return("SLES_BCL") + expect(subject.all_products.size).to eq(2) + end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.1.48/package/yast2.changes new/yast2-4.1.53/package/yast2.changes --- old/yast2-4.1.48/package/yast2.changes 2019-01-07 11:39:08.000000000 +0100 +++ new/yast2-4.1.53/package/yast2.changes 2019-01-18 09:50:21.000000000 +0100 @@ -1,4 +1,40 @@ ------------------------------------------------------------------- +Thu Jan 17 00:55:03 UTC 2019 - knut.anders...@suse.com + +- CWM: Added date field and time field widgets (fate#322722) +- 4.1.53 + +------------------------------------------------------------------- +Wed Jan 16 16:52:19 CET 2019 - sch...@suse.de + +- Support special products which will be enabled via linuxrc + (flag "specialproduct") (fate#327099) +- 4.1.52 + +------------------------------------------------------------------- +Wed Jan 16 13:03:59 UTC 2019 - jreidin...@suse.com + +- Firewall: drop not needed relations and its related methods +- Firewall: move export method to yast2-firewall (fate#324662) +- 4.1.51 + +------------------------------------------------------------------- +Mon Jan 14 10:55:20 UTC 2019 - Josef Reidinger <jreidin...@suse.com> + +- CWM: Add method focus to object CWM widgets (FATE#324662) +- CWM: Add rspec helper for common CWM widgets +- CWM: Allow CWM dialogs/popups to have own help +- CWM: Fix showing help for CWM Popup (FATE#324662) +- 4.1.50 + +------------------------------------------------------------------- +Thu Jan 10 14:45:03 UTC 2019 - Josef Reidinger <jreidin...@suse.com> + +- Fix crashes of many modules when invoking from ncurses control + center (bsc#1121425) +- 4.1.49 + +------------------------------------------------------------------- Mon Jan 7 08:40:21 UTC 2019 - lsle...@suse.cz - Ignore the old packages when fetching the release notes diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.1.48/package/yast2.spec new/yast2-4.1.53/package/yast2.spec --- old/yast2-4.1.48/package/yast2.spec 2019-01-07 11:39:08.000000000 +0100 +++ new/yast2-4.1.53/package/yast2.spec 2019-01-18 09:50:21.000000000 +0100 @@ -17,7 +17,7 @@ Name: yast2 -Version: 4.1.48 +Version: 4.1.53 Release: 0 Summary: YaST2 - Main Package License: GPL-2.0-only @@ -95,6 +95,8 @@ Conflicts: yast2-dns-server < 3.1.17 # InstError Conflicts: yast2-installation < 2.18.5 +# moved export method +Conflicts: yast2-installation < 4.1.8 # moved cfg_mail.scr Conflicts: yast2-mail < 3.1.7 # Older packager use removed API