Hello community, here is the log from the commit of package yast2-http-server for openSUSE:Factory checked in at 2018-08-12 20:54:35 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2-http-server (Old) and /work/SRC/openSUSE:Factory/.yast2-http-server.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2-http-server" Sun Aug 12 20:54:35 2018 rev:83 rq:628626 version:4.1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2-http-server/yast2-http-server.changes 2018-07-03 23:34:29.604396560 +0200 +++ /work/SRC/openSUSE:Factory/.yast2-http-server.new/yast2-http-server.changes 2018-08-12 20:54:37.217375555 +0200 @@ -1,0 +2,7 @@ +Wed Aug 8 14:58:09 UTC 2018 - [email protected] + +- Use new Yast2::ServiceWidget to manage the service status + (part of fate#319428). +- 4.1.0 + +------------------------------------------------------------------- Old: ---- yast2-http-server-4.0.3.tar.bz2 New: ---- yast2-http-server-4.1.0.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2-http-server.spec ++++++ --- /var/tmp/diff_new_pack.xs02LK/_old 2018-08-12 20:54:39.213379607 +0200 +++ /var/tmp/diff_new_pack.xs02LK/_new 2018-08-12 20:54:39.213379607 +0200 @@ -17,7 +17,7 @@ Name: yast2-http-server -Version: 4.0.3 +Version: 4.1.0 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -31,17 +31,18 @@ BuildRequires: popt-devel BuildRequires: sgml-skel BuildRequires: update-desktop-files -BuildRequires: yast2 >= 4.0.36 BuildRequires: yast2-devtools >= 3.1.10 BuildRequires: yast2-network BuildRequires: yast2-packagemanager-devel BuildRequires: yast2-perl-bindings BuildRequires: yast2-testsuite +# Yast2::ServiceWidget +BuildRequires: yast2 >= 4.1.0 Requires: libzio Requires: yast2-network Requires: yast2-perl-bindings -# SuSEFirewall2 replaced by firewalld yast2.rpm (fate#323460) -Requires: yast2 >= 4.0.39 +# Yast2::ServiceWidget +Requires: yast2 >= 4.1.0 BuildArch: noarch ++++++ yast2-http-server-4.0.3.tar.bz2 -> yast2-http-server-4.1.0.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-http-server-4.0.3/package/yast2-http-server.changes new/yast2-http-server-4.1.0/package/yast2-http-server.changes --- old/yast2-http-server-4.0.3/package/yast2-http-server.changes 2018-07-02 18:11:04.000000000 +0200 +++ new/yast2-http-server-4.1.0/package/yast2-http-server.changes 2018-08-10 15:01:50.000000000 +0200 @@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Wed Aug 8 14:58:09 UTC 2018 - [email protected] + +- Use new Yast2::ServiceWidget to manage the service status + (part of fate#319428). +- 4.1.0 + +------------------------------------------------------------------- Thu Jun 28 10:47:18 CEST 2018 - [email protected] - Added additional searchkeys to desktop file (fate#321043). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-http-server-4.0.3/package/yast2-http-server.spec new/yast2-http-server-4.1.0/package/yast2-http-server.spec --- old/yast2-http-server-4.0.3/package/yast2-http-server.spec 2018-07-02 18:11:04.000000000 +0200 +++ new/yast2-http-server-4.1.0/package/yast2-http-server.spec 2018-08-10 15:01:50.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2-http-server -Version: 4.0.3 +Version: 4.1.0 Release: 0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -27,10 +27,11 @@ License: GPL-2.0 BuildRequires: yast2-network docbook-xsl-stylesheets doxygen libxslt perl-XML-Writer popt-devel sgml-skel update-desktop-files yast2-packagemanager-devel yast2-perl-bindings yast2-testsuite libzio BuildRequires: yast2-devtools >= 3.1.10 -BuildRequires: yast2 >= 4.0.36 +# Yast2::ServiceWidget +BuildRequires: yast2 >= 4.1.0 Requires: yast2-network yast2-perl-bindings libzio -# SuSEFirewall2 replaced by firewalld yast2.rpm (fate#323460) -Requires: yast2 >= 4.0.39 +# Yast2::ServiceWidget +Requires: yast2 >= 4.1.0 BuildArchitectures: noarch diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-http-server-4.0.3/src/include/http-server/dialogs.rb new/yast2-http-server-4.1.0/src/include/http-server/dialogs.rb --- old/yast2-http-server-4.0.3/src/include/http-server/dialogs.rb 2018-07-02 18:11:04.000000000 +0200 +++ new/yast2-http-server-4.1.0/src/include/http-server/dialogs.rb 2018-08-10 15:01:50.000000000 +0200 @@ -34,19 +34,16 @@ HStretch(), HSpacing(1), VBox( - "server_enable", #, - # `VSpacing(1) - # `VSpacing (1), + "service_widget", "LISTEN", - # `VSpacing (1), "firewall_adapt", - # `VSpacing (1), "logs" ), # `HSpacing (1), HStretch() ), "widget_names" => [ + "service_widget", "server_enable", "LISTEN", "firewall_adapt", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-http-server-4.0.3/src/modules/HttpServer.rb new/yast2-http-server-4.1.0/src/modules/HttpServer.rb --- old/yast2-http-server-4.0.3/src/modules/HttpServer.rb 2018-07-02 18:11:04.000000000 +0200 +++ new/yast2-http-server-4.1.0/src/modules/HttpServer.rb 2018-08-10 15:01:50.000000000 +0200 @@ -10,6 +10,7 @@ # Representation of the configuration of http-server. # Input and output routines. require "yast" +require "yast2/system_service" require "y2firewall/firewalld" module Yast @@ -37,6 +38,7 @@ Yast.import "Confirm" Yast.import "FileChanges" Yast.import "Label" + Yast.import "Mode" # Abort function # return boolean return true if abort @@ -79,6 +81,13 @@ IGNORED_FILES = ["vhost.template", "vhost-ssl.template"] APACHE_VHOSTS_DIR = "/etc/apache2/vhosts.d" + # Returns the apache2 service + # + # @return [Yast2::SystemService] + def service + @service ||= Yast2::SystemService.find("apache2") + end + def firewalld Y2Firewall::Firewalld.instance end @@ -402,65 +411,52 @@ end # Write all http-server settings + # # @return true on success def Write - # HttpServer read dialog caption + # HttpServer write dialog caption caption = _("Saving HTTP Server Configuration") - steps = 3 - - # We do not set help text here, because it was set outside - Progress.New( - caption, - " ", - steps, - [ - # translators: progress stage 1/3 - _("Write the Apache2 settings"), - YaST::HTTPDData.GetService ? - # translators: progress stage 2/3 - _("Enable Apache2 service") : - # translators: progress stage 3/3 - _("Disable Apache2 service") - ], - [ - # translators: progress step 1/3 - _("Writing the settings..."), - YaST::HTTPDData.GetService ? - # translators: progress step 2/3 - _("Enabling Apache2 service...") : - # translators: progress step 3/3 - _("Disabling Apache2 service..."), - # translators: progress finished - _("Finished") - ], - "" - ) + stages = [ + # translators: progress stage 1/2 + _("Write the Apache2 settings"), + # translators: progress stage 2/2 + _("Save the Apache2 service status") + ] + steps = [ + # translators: progress step 1/3 + _("Writing the settings..."), + # translators: progress step 2/3 + _("Saving the Apache2 service status..."), + # translators: progress step 3/3, finished + _("Finished") + ] - # write Apache2 settings + Progress.New(caption, " ", steps.count, stages, steps, "") + # Write Apache2 settings rpms = YaPI::HTTPD.GetModulePackages - # install required RPMs for modules + # Install required RPMs for modules Package.InstallAllMsg( rpms, _( "The enabled modules require\n" + - "installation of some of these additional packages:\n" + - "%1\n" + - "Install them now?\n" + "installation of some of these additional packages:\n" + + "%1\n" + + "Install them now?\n" ) ) - # write httpd.conf - - # write hosts + # Write httpd.conf + # Write hosts backup_vhost_config + YaST::HTTPDData.WriteHosts Progress.NextStage old_progress = Progress.set(false) # off(); - # always adapt firewall + # Always adapt firewall if YaST::HTTPDData.WriteListen(false) == nil # FIXME: show popup @@ -480,34 +476,17 @@ log.info("The apache2 service is not defined in firewalld") end - DnsServerAPI.Write if @configured_dns Progress.set(old_progress) YaST::HTTPDData.WriteModuleList - # in autoyast, quit here - # Wrong, service still has to be enabled... - # if( write_only ) return true; - Progress.NextStage - if !YaST::HTTPDData.WriteService(@write_only) + if !save_status # translators: error message - Report.Error(Message.CannotAdjustService("apache2")) + Report.Error(Message.CannotAdjustService(service.name)) end - if YaST::HTTPDData.GetService - # this will reload the configuration and start httpd - if !Service.Restart("apache2") - # translators: error message - Report.Error(Message.CannotAdjustService("apache2")) - end - else - if !Service.Stop("apache2") - # translators: error message - Report.Error(Message.CannotAdjustService("apache2")) - end - end # configuration test # map<string, any> test = (map<string, any>)SCR::Execute(.target.bash_output, "apache2ctl conftest"); #y2internal("test %1", test); @@ -522,6 +501,21 @@ true end + # Saves service status (start mode and starts/stops the service) + # + # @note For AutoYaST and for command line actions, it uses the old way for + # backward compatibility, see {Yast::HTTPDData#WriteService}. When the + # service is configured by using the UI, it directly saves the service, see + # {Yast2::SystemService#save}. + # + # @return [Boolean] true if service status is saved; false otherwise. + def save_status + if Mode.auto || Mode.commandline + Yast::HTTPDData.WriteService(@write_only) + else + service.save + end + end # For module name find description map in known_modules # @param [Array<Hash{String => Object>}] known_modules list< map<string,any> > known modules diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-http-server-4.0.3/src/modules/HttpServerWidgets.rb new/yast2-http-server-4.1.0/src/modules/HttpServerWidgets.rb --- old/yast2-http-server-4.0.3/src/modules/HttpServerWidgets.rb 2018-07-02 18:11:04.000000000 +0200 +++ new/yast2-http-server-4.1.0/src/modules/HttpServerWidgets.rb 2018-08-10 15:01:50.000000000 +0200 @@ -9,9 +9,11 @@ # # $Id$ require "yast" +require "cwm/service_widget" module Yast class HttpServerWidgetsClass < Module + def main Yast.import "UI" @@ -23,14 +25,12 @@ Yast.import "Label" Yast.import "Popup" Yast.import "Report" - Yast.import "Service" Yast.import "String" Yast.import "LogView" Yast.import "TablePopup" Yast.import "HttpServer" Yast.import "YaST::HTTPDData" Yast.import "Confirm" - Yast.import "CWMServiceStart" Yast.import "CWMFirewallInterfaces" Yast.import "Punycode" Yast.import "Package" @@ -355,34 +355,7 @@ # Map of widgets for CWM def widgets @widgets ||= { - "server_enable" => { - "widget" => :radio_buttons, - # translator: server enable/disable radio button group - "label" => _( - "HTTP &Service" - ), - "items" => [ - # translators: service status radio button label - ["disabled", _("Disabled")], - # translators: service status radio button label - ["enabled", _("Enabled")] - ], - "init" => fun_ref( - method(:initServiceStatus), - "void (string)" - ), - "handle" => fun_ref( - method(:handleServiceStatus), - "symbol (string, map)" - ), - "store" => fun_ref( - method(:storeServiceStatus), - "void (string, map)" - ), - "handle_events" => ["enabled", "disabled"], - "opt" => [:notify], - "help" => @HELPS["server_enable"] - }, + "service_widget" => service_widget.cwm_definition, "firewall_adapt" => CWMFirewallInterfaces.CreateOpenFirewallWidget( { # Firewalld already defines the http and https services. This @@ -596,26 +569,7 @@ ), "help" => Ops.get_string(@HELPS, "listen_interfaces", "") }, - "booting" => CWMServiceStart.CreateAutoStartWidget( - { - "get_service_auto_start" => fun_ref( - method(:getServiceAutoStart), - "boolean ()" - ), - "set_service_auto_start" => fun_ref( - method(:setServiceAutoStart), - "void (boolean)" - ), - #translators: radiobutton - to start Apache2 service automatically - "start_auto_button" => _( - "Start Apache2 Server When Booting" - ), - #translators: radiobutton - to don't start Apache2 service - "start_manual_button" => _( - "Start Apache2 Server Manually" - ) - } - ), + "booting" => service_widget.cwm_definition, "expert_conf" => { "widget" => :push_button, #translators: button to enter expert configuration @@ -804,6 +758,13 @@ } end + # Rerturns a service widget + # + # @return [::CWM::ServiceWidget] + def service_widget + @service_widget ||= ::CWM::ServiceWidget.new(HttpServer.service) + end + # Validate certificate # @return [Boolean] certificate valid def CheckCommonServerCertificate @@ -3363,6 +3324,7 @@ # ************************************ server status *********************** + # @deprecated Service status is now managed by Yast2::ServiceWidget # Initialize function of a widget # @param [String] key any widget key of widget that is processed def initServiceStatus(key) @@ -3375,6 +3337,7 @@ nil end + # @deprecated Service status is now managed by Yast2::ServiceWidget # Store function of a widget # @param [String] key any widget key of widget that is processed # @param [Hash] event map event that occured @@ -3387,6 +3350,8 @@ nil end + + # @deprecated Service status is now managed by Yast2::ServiceWidget # Handling service status # @param [String] key string # @param [Hash] event map
