Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package yast2 for openSUSE:Factory checked in at 2021-04-23 17:50:19 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2 (Old) and /work/SRC/openSUSE:Factory/.yast2.new.12324 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2" Fri Apr 23 17:50:19 2021 rev:508 rq:886566 version:4.4.1 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2/yast2.changes 2021-03-30 20:51:38.228132295 +0200 +++ /work/SRC/openSUSE:Factory/.yast2.new.12324/yast2.changes 2021-04-23 17:50:23.354769788 +0200 @@ -1,0 +2,19 @@ +Fri Apr 16 12:03:50 UTC 2021 - Imobach Gonzalez Sosa <igonzalezs...@suse.com> + +- Add a mechanism to report issues to the user (related to + bsc#1181295). +- 4.4.1 + +------------------------------------------------------------------- +Wed Apr 14 12:09:49 UTC 2021 - Ladislav Slez??k <lsle...@suse.cz> + +- Updated manual page ("man yast2") (bsc#1184681) +- 4.4.0 + +------------------------------------------------------------------- +Mon Apr 12 15:12:41 UTC 2021 - Imobach Gonzalez Sosa <igonzalezs...@suse.com> + +- Add a default value for file_path argument in ::new and ::load + methods of CFA::LoginDefs class. + +------------------------------------------------------------------- Old: ---- yast2-4.3.60.tar.bz2 New: ---- yast2-4.4.1.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2.spec ++++++ --- /var/tmp/diff_new_pack.oS14Gh/_old 2021-04-23 17:50:24.050770985 +0200 +++ /var/tmp/diff_new_pack.oS14Gh/_new 2021-04-23 17:50:24.054770991 +0200 @@ -17,7 +17,7 @@ Name: yast2 -Version: 4.3.60 +Version: 4.4.1 Release: 0 Summary: YaST2 Main Package License: GPL-2.0-only ++++++ yast2-4.3.60.tar.bz2 -> yast2-4.4.1.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.3.60/.coveralls.yml new/yast2-4.4.1/.coveralls.yml --- old/yast2-4.3.60/.coveralls.yml 2021-03-29 14:49:41.000000000 +0200 +++ new/yast2-4.4.1/.coveralls.yml 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -service_name: travis-ci diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.3.60/doc/yast2.8 new/yast2-4.4.1/doc/yast2.8 --- old/yast2-4.3.60/doc/yast2.8 2021-03-29 14:49:41.000000000 +0200 +++ new/yast2-4.4.1/doc/yast2.8 2021-04-19 08:37:30.000000000 +0200 @@ -1,14 +1,17 @@ -.\" Michal Svec <ms...@suse.cz> .\" .\" Process this file with -.\" groff -man -Tascii foo.1 +.\" groff -man -Tutf8 yast2.8 +.\" or run +.\" man -l yast2.8 +.\" to display the man page without installing it .\" +.\" See https://www.gnu.org/software/groff/manual/html_node/man.html#man .\" -.TH YAST2 8 "January 2003" "yast2" "System configuration" +.TH YAST 8 "April 2021" "yast" "System configuration" .\" .\" .SH NAME -YaST2 \- universal configuration utility +YaST \- "Yet another Setup Tool", the installation and configuration tool .\" .\" .SH SYNOPSIS @@ -19,43 +22,33 @@ .B ] [ .I module specific options .B ] -.br -.B yast2 --install -.I <package> -.B [ -.I <package> -.B [ -.I ... -.B ] ] .\" .\" .SH DESCRIPTION -.B YaST2 -is used to configure the system. It can configure a common hardware -(sound cards, printers, keyboards, mice), network connections (network -cards, ISDN cards, modems, DSL connections), network clients and services -(NFS, NIS), as well as a general system options (language, partitioning, -software, bootloader). - -.br -.B YaST2 -comes with three frontends: -.B GTK -, -.B QT -and -.B ncurses. -All frontends are functionally equivalent. -The correct frontend is selected automatically based on the available -components and the current environment (the DISPLAY variable). - -.br +.B YaST +can be used to configure the system. It can configure common hardware +(sound cards, printers), network connections (network cards), network +clients and services (like NFS, FTP), as well as general system options +(language, partitioning, software, bootloader). +.\" +.P +.B YaST +comes with +.B Qt +(graphical) and +.B ncurses +(text mode) frontends located in libyui-qt and libyui-ncurses packages. Both frontends are +functionally equivalent. The correct frontend is selected automatically based +on the available components and the current environment (the DISPLAY variable). +.\" +.P Use .B yast2 alone to launch the -.B YaST2 Control Center +.B YaST Control Center from which you can select a particular configuration module or use -.B yast2 <module> +.B yast2 +.I module to launch the module directly. .\" .\" @@ -63,57 +56,34 @@ .\" .TP .B --qt -Run YaST in the QT graphical frontend -.\" -.TP -.B --gtk -Run YaST in the GTK graphical frontend +Run YaST in the Qt graphical frontend if available, otherwise it uses the +ncurses frontend .\" .TP .B --ncurses -Run YaST in the ncurses text-mode frontend +Run YaST in the ncurses text mode frontend .\" .TP .B -g, --geometry -Default window size (QT frontend only). +Default window size (Qt frontend only), e.g. \fB800x600 .\" .TP .B -h, --help -Print a usage and exit. -.\" -.TP -.B -i, --install <package> [ <package> [ ... ] ] -Install an RPM package. The -.B package -can be a single short package name (e.g. gvim) -which will be installed with dependency checking, or the full -path to an rpm package (e.g /tmp/gvim.rpm) which will be -installed without dependency checking. -.\" -.\" #222757 -.TP -.B --remove <package> [ <package> [ ... ] ] -Remove an RPM package. The -.B package -can be short package names (e.g. gvim) -which will be removed with dependency checking. +Print usage and exit .\" .TP .B -l, --list -List all available modules. To obtain usage info about -a module, use "yast module help". +List all available modules, to obtain usage info about +a module use +.B yast +.I module +.B help +command. .\" .\" -.SH MODULES WITH COMMAND LINE INTERFACE +.SH COMMAND LINE INTERFACE .TP -This is a list of YaST modules currently supporting command line interface: -.P -answering_machine, bootloader, ca_mgm, dhcp-server, dns, dns-server, fax, -firewall, groups, host, http-server, idedma, inetd, irda, kerberos-client, -keyboard, lan, language, ldap, mail, mouse, nfs, nfs_server, nis, nis_server, -ntp-client, power-management, powertweak, printer, profile-manager, proxy, -remote, routing, runlevel, samba-client, samba-server, security, sound, -sysconfig, tftp-server, timezone, tv, users +Some YaST modules support command line interface. .\" .P To obtain a list of basic commands for using a YaST module @@ -143,7 +113,7 @@ .B yast2 .I module .B xmlhelp -.B xmlfile= \fI<filename>\fP +.B xmlfile=\fI<filename>\fP .br .\" .P @@ -171,12 +141,12 @@ .SH FILES .TP /var/log/YaST2/* -Logs +Log files, use the +.B save_y2logs +command for saving all files into a single archive .TP /etc/sysconfig/yast2, $HOME/.yast2/yast2 -Configures the preferred GUI. -\" .SH BUGS -\" Please report bugs at http://www.suse.de/feedback +YaST configuration files .\" .\" .SH "EXIT STATUS" @@ -199,8 +169,7 @@ .\" .SH AUTHOR .nf -Michal Svec <ms...@suse.cz> - manual page -Jakub Friedl <jfri...@suse.cz> - manual page +The YaST Team <yast-de...@opensuse.org> .fi .\" .\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.3.60/library/general/src/lib/cfa/login_defs.rb new/yast2-4.4.1/library/general/src/lib/cfa/login_defs.rb --- old/yast2-4.3.60/library/general/src/lib/cfa/login_defs.rb 2021-03-29 14:49:41.000000000 +0200 +++ new/yast2-4.4.1/library/general/src/lib/cfa/login_defs.rb 2021-04-19 08:37:30.000000000 +0200 @@ -65,6 +65,8 @@ :userdel_precmd ].freeze + DEFAULT_PATH = "/etc/login.defs".freeze + class << self # Returns the list of known attributes # @@ -80,7 +82,7 @@ # @param file_handler [#read,#write] something able to read/write a string (like File) # @param file_path [String] File path # @return [LoginDefs] File with the already loaded content - def load(file_path:, file_handler: Yast::TargetFile) + def load(file_path: DEFAULT_PATH, file_handler: Yast::TargetFile) new(file_path: file_path, file_handler: file_handler).tap(&:load) end end @@ -98,7 +100,7 @@ # @param file_path [String] File path # # @see CFA::BaseModel#initialize - def initialize(file_path:, file_handler: Yast::TargetFile) + def initialize(file_path: DEFAULT_PATH, file_handler: Yast::TargetFile) super(AugeasParser.new("login_defs.lns"), file_path, file_handler: file_handler) end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.3.60/library/general/src/lib/y2issues/invalid_value.rb new/yast2-4.4.1/library/general/src/lib/y2issues/invalid_value.rb --- old/yast2-4.3.60/library/general/src/lib/y2issues/invalid_value.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-4.4.1/library/general/src/lib/y2issues/invalid_value.rb 2021-04-19 08:37:30.000000000 +0200 @@ -0,0 +1,47 @@ +# Copyright (c) [2021] 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 "y2issues/issue" + +module Y2Issues + # Represents a situation where an invalid value was given + class InvalidValue < Issue + # @param location [URI, String] Error location ("file:/etc/sysconfig/ifcfg-eth0:BOOTPROTO") + # @param value [#to_s,nil] Invalid value or nil if no value was given + # @param fallback [#to_s] Value to use instead of the invalid one + def initialize(value, location:, fallback: nil, severity: :warn) + textdomain "base" + super(build_message(value, fallback), location: location, severity: severity) + end + + private + + def build_message(value, fallback) + msg = if value + format(_("Invalid value '%{value}'."), value: value) + else + _("A value is required.").dup + end + + msg << " " + format(_("Using '%{fallback}' instead."), fallback: fallback) if fallback + msg + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.3.60/library/general/src/lib/y2issues/issue.rb new/yast2-4.4.1/library/general/src/lib/y2issues/issue.rb --- old/yast2-4.3.60/library/general/src/lib/y2issues/issue.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-4.4.1/library/general/src/lib/y2issues/issue.rb 2021-04-19 08:37:30.000000000 +0200 @@ -0,0 +1,66 @@ +# Copyright (c) [2021] 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 "y2issues/location" + +module Y2Issues + # Represents a problem detected by YaST. + # + # This class represents a generic error. Other classes can inherit from this one to add more + # specific information. See {InvalidValue} as an example. + # + # @example Create a new error + # Issue.new("Could not read network configuration", severity: :fatal) + # + # @example Create an error from an specific location + # Issue.new( + # "Could not read the routing table", + # location: "file:/etc/sysconfig/ifroute-eth0", + # severity: :warn + # ) + class Issue + include Yast::I18n + + # @return [String,nil] Where the error is located. + attr_reader :location + # @return [String] Error message + attr_reader :message + # @return [Symbol] Error severity (:warn, :fatal) + attr_reader :severity + + # @param message [String] User-oriented message describing the problem + # @param location [URI,String,nil] Where the error is located. Use a URI or + # a string to represent the error location. Use 'nil' if it + # does not exist an specific location. + # @param severity [Symbol] warning (:warn) or fatal (:fatal) + def initialize(message, location: nil, severity: :warn) + @message = message + @location = Location.parse(location) if location + @severity = severity + end + + # Determines whether the error is fatal or not + # + # @return [Boolean] + def fatal? + @severity == :fatal + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.3.60/library/general/src/lib/y2issues/list.rb new/yast2-4.4.1/library/general/src/lib/y2issues/list.rb --- old/yast2-4.3.60/library/general/src/lib/y2issues/list.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-4.4.1/library/general/src/lib/y2issues/list.rb 2021-04-19 08:37:30.000000000 +0200 @@ -0,0 +1,51 @@ +# Copyright (c) [2021] 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 "forwardable" + +module Y2Issues + # List of YaST issues + class List + include Enumerable + extend Forwardable + + def_delegators :@items, :each, :empty?, :<< + + # Constructor + # + # @param issues [Array<Issue>] Issues to include in the list + def initialize(issues = []) + @items = issues + end + + # Determine whether any of the problem on the list is fatal + # + # @return [Boolean] true if any of them is a fatal problem + def fatal? + any?(&:fatal?) + end + + # Returns an array containing registered problems + # + # @return [Array<Issue>] List of problems + def to_a + @items + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.3.60/library/general/src/lib/y2issues/location.rb new/yast2-4.4.1/library/general/src/lib/y2issues/location.rb --- old/yast2-4.3.60/library/general/src/lib/y2issues/location.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-4.4.1/library/general/src/lib/y2issues/location.rb 2021-04-19 08:37:30.000000000 +0200 @@ -0,0 +1,93 @@ +# Copyright (c) [2021] 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. + +module Y2Issues + # Represent the location of an error + # + # It can be a file, a section of an AutoYaST profile, etc. This class is rather open and + # its API might change once we know more about error reporting. + # + # The concept of "location" is introduce to tell the user where to look for a problem and as + # a mechanism to group the issues. + # + # A location is composed by three parts: + # + # * type: whether the location is a file, an AutoYaST profile section, etc. + # * path: location path (file path, AutoYaST profile path, etc.) + # * id: it can be the file line, a key, an AutoYaST element name, etc. This element is optional. + class Location + # @return [String] Location type ("file", "autoyast", etc.) + attr_reader :type + # @return [String] Location path (a file path, an AutoYaST section path, and so on) + attr_reader :path + # @return [String,nil] Location ID within the path + attr_reader :id + + # Parse a string and creates a location + # + # The string contains the type, the path and the id, separated by colons. + # + # @example AutoYaST section reference + # location = Location.parse("autoyast:partitioning,1,partition,0:filesystem_type") + # location.type #=> "ay" + # location.path #=> "partitioning,1,partition,0" + # location.id #=> "filesystem_type" + # + # @example File reference + # location = Location.parse("file:/etc/sysconfig/network/ifcfg-eth0:BOOTPROTO") + # location.type #=> "file" + # location.path #=> "/etc/sysconfig/network/ifcfg-eth0" + # location.id #=> "BOOTPROTO" + # + # @param str [String] String representing the path + # @return [Location] + # @see #to_s + def self.parse(str) + type, path, id = str.split(":") + new(type, path, id) + end + + # @param type [String] Location type + # @param path [String] Location path + # @param id [String,nil] Location ID, if needed + def initialize(type, path, id = nil) + @type = type + @path = path + @id = id + end + + # Returns a string-based representation of the location + # + # @return [String] String-based representation + # @see .parse + def to_s + [type, path, id].compact.join(":") + end + + # Determines whether two locations are the same + # + # @param other [Location] + # @return [Boolean] + def ==(other) + type == other.type && path == other.path && id == other.id + end + + alias_method :eql?, :== + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.3.60/library/general/src/lib/y2issues/presenter.rb new/yast2-4.4.1/library/general/src/lib/y2issues/presenter.rb --- old/yast2-4.3.60/library/general/src/lib/y2issues/presenter.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-4.4.1/library/general/src/lib/y2issues/presenter.rb 2021-04-19 08:37:30.000000000 +0200 @@ -0,0 +1,125 @@ +# Copyright (c) [2021] 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 "HTML" +Yast.import "RichText" + +module Y2Issues + # This class converts a list of issues into a message for users + # + # @todo Separate by severity, group items, etc. + class Presenter + include Yast::I18n + + # @return [List] List of issues to present + attr_reader :issues + + # @param issues [List] Issues list + def initialize(issues) + textdomain "base" + @issues = issues + end + + # Return the text to be shown to the user regarding the list of issues + # + # @return [String] Plain text + def to_plain + Yast::RichText.Rich2Plain(to_html) + end + + # Return the HTML representation of a list of issues + # + # @return [String] HTML representing the list of issues + def to_html + fatal, non_fatal = issues.partition(&:fatal?) + parts = [] + parts << error_text(fatal) unless fatal.empty? + parts << warning_text(non_fatal) unless non_fatal.empty? + + parts.join + end + + private + + # Return warning message with a list of issues + # + # @param issues [Array<Issue>] List of issues to include in the message + # @return [String] Message + def warning_text(issues) + Yast::HTML.Para( + _("Minor issues were detected:") + ) + issues_list_content(issues) + end + + # Return error message with a list of issues + # + # @param issues [Array<Issue>] List of issues to include in the message + # @return [String] Message + def error_text(issues) + Yast::HTML.Para( + _("Important issues were detected:") + ) + issues_list_content(issues) + end + + # Return an HTML representation for a list of issues + # + # The issues are grouped by the location where they were detected. General issues (with no + # specific location) are listed first. + # + # @return [String] Issues list content + # + # @see issues_by_location + def issues_list_content(issues) + all_issues = [] + issues_map = issues_by_location(issues) + + if issues_map[:nolocation] + all_issues += issues_map[:nolocation].map(&:message) + issues_map.delete(:nolocation) + end + + issues_map.each do |group, items| + messages = Yast::HTML.List( + items.map { |i| "#{i.location.id}: #{i.message}" } + ) + path = group.split(":").last + all_issues << "#{path}:#{messages}" + end + + Yast::HTML.List(all_issues) + end + + # Return issues grouped by location where they were found + # + # @return [Hash<String,Issue>] + # Issues grouped by location type and path. + def issues_by_location(issues) + issues.each_with_object({}) do |issue, all| + group = if issue.location + "#{issue.location.type}:#{issue.location.path}" + else + :nolocation + end + all[group] ||= [] + all[group] << issue + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.3.60/library/general/src/lib/y2issues/reporter.rb new/yast2-4.4.1/library/general/src/lib/y2issues/reporter.rb --- old/yast2-4.3.60/library/general/src/lib/y2issues/reporter.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-4.4.1/library/general/src/lib/y2issues/reporter.rb 2021-04-19 08:37:30.000000000 +0200 @@ -0,0 +1,96 @@ +# Copyright (c) [2021] 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 "y2issues" + +Yast.import "Label" +Yast.import "Report" + +module Y2Issues + # This class provides a mechanism to report YaST2 issues + # + # In order to integrate nicely with AutoYaST, it honors the Yast::Report + # settings. + class Reporter + include Yast::I18n + include Yast::Logger + + # @param issues [List] Issues list + # @param report_settings [Hash] Report settings (see Report.Export) + def initialize(issues, report_settings: Yast::Report.Export) + textdomain "base" + @presenter = Presenter.new(issues) + @level = issues.fatal? ? :error : :warn + @log, @show, @timeout = find_settings(report_settings, @level) + end + + # Reports the issues to the user + # + # Depending on the given report settings, it may display a pop-up, and/or log the error. + def report + log_issues if @log + show_issues if @show + end + + private + + attr_reader :level, :presenter + + # Displays a pop-up containing the issues + # + # It can behave in two different ways depending if a fatal issue was found: + # + # * Ask the user if she/he wants to continue or abort the installation. + # * Display a message and only offer an 'Abort' button. + def show_issues + if level == :error + headline = :error + buttons = { abort: Yast::Label.AbortButton } + question = _("Please, correct these problems and try again.") + timeout = 0 + else + headline = :warning + buttons = :yes_no + question = _("Do you want to continue?") + timeout = @timeout + end + + content = presenter.to_html + Yast::HTML.Para(question) + Yast2::Popup.show( + content, richtext: true, headline: headline, buttons: buttons, timeout: timeout + ) + end + + # Writes the issues + def log_issues + log.send(level, presenter.to_plain) + end + + # Reads reporting settings depending on the error level + # + # @param settings [Hash] Reporting settings (as exported by Report.Export) + # @param level [Symbol] :error or :warn + def find_settings(settings, level) + key = (level == :error) ? "errors" : "warnings" + hash = settings[key] + [hash["log"], hash["show"], hash["timeout"]] + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.3.60/library/general/src/lib/y2issues.rb new/yast2-4.4.1/library/general/src/lib/y2issues.rb --- old/yast2-4.3.60/library/general/src/lib/y2issues.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-4.4.1/library/general/src/lib/y2issues.rb 2021-04-19 08:37:30.000000000 +0200 @@ -0,0 +1,52 @@ +# Copyright (c) [2021] 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. + +# This module offers a mechanism to register and report issues to the user. +# +# It includes: +# +# * A set of classes to represent the issues ({Y2Issues::Issue}, +# {Y2Issues::InvalidValue}). +# * A class to collect errors ({Y2Issues::List}). +# * A presenter to help when presenting the issues to the user ({Y2Issues::Presenter}). +# +# @example Registering an error +# list = Y2Issues::List.new +# list << Y2Issues::Issue.new("Could not read network configuration", severity: :fatal) +module Y2Issues + # Reports the errors to the user + # + # This is a helper method that offers an stable API on top of {Reporter}. Depending on + # Yast::Report settings, it may show a pop-up with the found issues and log them. + # + # @param [List] Issues list + # @see Y2Issues::Reporter + def self.report(issues) + Reporter.new(issues).report + end +end + +require "y2issues/list" +require "y2issues/presenter" +require "y2issues/location" +require "y2issues/reporter" + +# Issues types +require "y2issues/issue" +require "y2issues/invalid_value" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.3.60/library/general/src/modules/ShadowConfig.rb new/yast2-4.4.1/library/general/src/modules/ShadowConfig.rb --- old/yast2-4.3.60/library/general/src/modules/ShadowConfig.rb 2021-03-29 14:49:41.000000000 +0200 +++ new/yast2-4.4.1/library/general/src/modules/ShadowConfig.rb 2021-04-19 08:37:30.000000000 +0200 @@ -23,7 +23,6 @@ module Yast # This class allows to access the API to handle login.defs attributes from Perl # - # @see CFA::LoginDefs # @see CFA::ShadowConfig class ShadowConfigClass < Module include Logger diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.3.60/library/general/test/cfa/login_defs_test.rb new/yast2-4.4.1/library/general/test/cfa/login_defs_test.rb --- old/yast2-4.3.60/library/general/test/cfa/login_defs_test.rb 2021-03-29 14:49:41.000000000 +0200 +++ new/yast2-4.4.1/library/general/test/cfa/login_defs_test.rb 2021-04-19 08:37:30.000000000 +0200 @@ -90,4 +90,22 @@ end end end + + describe "#present_attributes" do + it "returns the list of present attributes" do + expect(login_defs.present_attributes).to include(*ATTRS_VALUES.keys) + end + end + + describe "#conflicts" do + subject(:other) { described_class.new(file_path: file_path, file_handler: file_handler) } + + before do + other.encrypt_method = "SHA256" + end + + it "returns the list of attributes with different values" do + expect(login_defs.conflicts(other)).to eq([:encrypt_method]) + end + end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.3.60/library/general/test/login_defs_config_test.rb new/yast2-4.4.1/library/general/test/login_defs_config_test.rb --- old/yast2-4.3.60/library/general/test/login_defs_config_test.rb 2021-03-29 14:49:41.000000000 +0200 +++ new/yast2-4.4.1/library/general/test/login_defs_config_test.rb 1970-01-01 01:00:00.000000000 +0100 @@ -1,80 +0,0 @@ -# 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" - -Yast.import "ShadowConfig" - -describe Yast::ShadowConfig do - subject { Yast::ShadowConfig } - let(:config_path) { File.join(GENERAL_DATA_PATH, "login.defs", "vendor") } - - before { subject.main } - - around do |example| - change_scr_root(config_path, &example) - end - - describe "#fetch" do - context "when the value is defined" do - it "returns the value for the given attribute" do - expect(subject.fetch(:encrypt_method)).to eq("SHA512") - end - end - - context "when the value is unknown" do - it "raises an exception" do - expect { subject.fetch(:unknown) } - .to raise_error(Yast::ShadowConfigClass::UnknownAttributeError) - end - end - end - - describe "#set" do - context "when the value is defined" do - it "sets the attribute to the given value" do - expect { subject.set(:encrypt_method, "SHA256") } - .to change { subject.fetch(:encrypt_method) } - .from("SHA512").to("SHA256") - end - end - - context "when the value is unknown" do - it "raises an exception" do - expect { subject.set(:unknown, "unknown") } - .to raise_error(Yast::ShadowConfigClass::UnknownAttributeError) - end - end - end - - describe "#write" do - let(:shadow_config) { CFA::ShadowConfig.new } - - before do - allow(CFA::ShadowConfig).to receive(:new) - .and_return(shadow_config) - subject.reset - end - - it "saves the changes" do - expect(shadow_config).to receive(:save) - subject.write - end - end -end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.3.60/library/general/test/shadow_config_test.rb new/yast2-4.4.1/library/general/test/shadow_config_test.rb --- old/yast2-4.3.60/library/general/test/shadow_config_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-4.4.1/library/general/test/shadow_config_test.rb 2021-04-19 08:37:30.000000000 +0200 @@ -0,0 +1,80 @@ +# 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" + +Yast.import "ShadowConfig" + +describe Yast::ShadowConfig do + subject { Yast::ShadowConfig } + let(:config_path) { File.join(GENERAL_DATA_PATH, "login.defs", "vendor") } + + before { subject.main } + + around do |example| + change_scr_root(config_path, &example) + end + + describe "#fetch" do + context "when the value is defined" do + it "returns the value for the given attribute" do + expect(subject.fetch(:encrypt_method)).to eq("SHA512") + end + end + + context "when the value is unknown" do + it "raises an exception" do + expect { subject.fetch(:unknown) } + .to raise_error(Yast::ShadowConfigClass::UnknownAttributeError) + end + end + end + + describe "#set" do + context "when the value is defined" do + it "sets the attribute to the given value" do + expect { subject.set(:encrypt_method, "SHA256") } + .to change { subject.fetch(:encrypt_method) } + .from("SHA512").to("SHA256") + end + end + + context "when the value is unknown" do + it "raises an exception" do + expect { subject.set(:unknown, "unknown") } + .to raise_error(Yast::ShadowConfigClass::UnknownAttributeError) + end + end + end + + describe "#write" do + let(:shadow_config) { CFA::ShadowConfig.new } + + before do + allow(CFA::ShadowConfig).to receive(:new) + .and_return(shadow_config) + subject.reset + end + + it "saves the changes" do + expect(shadow_config).to receive(:save) + subject.write + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.3.60/library/general/test/y2issues/invalid_value_test.rb new/yast2-4.4.1/library/general/test/y2issues/invalid_value_test.rb --- old/yast2-4.3.60/library/general/test/y2issues/invalid_value_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-4.4.1/library/general/test/y2issues/invalid_value_test.rb 2021-04-19 08:37:30.000000000 +0200 @@ -0,0 +1,58 @@ +#!/usr/bin/env rspec +# Copyright (c) [2021] 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 "y2issues/invalid_value" + +describe Y2Issues::InvalidValue do + subject(:issue) do + described_class.new("dhcpd", location: "file:/etc/sysconfig/network/ifcfg-eth0") + end + + describe "#message" do + it "returns a message explaining the problem" do + expect(issue.message).to eq("Invalid value 'dhcpd'.") + end + + context "when the nil value was given" do + subject(:issue) do + described_class.new(nil, location: "file:/etc/sysconfig/network/ifcfg-eth0") + end + + it "returns a message explaining the problem" do + expect(issue.message).to eq("A value is required.") + end + end + + context "when a fallback value is given" do + subject(:issue) do + described_class.new( + "dhcpd", location: "file:/etc/sysconfig/network/ifcfg-eth0", fallback: "auto" + ) + end + + it "includes the fallback value in the message" do + expect(issue.message).to eq( + "Invalid value 'dhcpd'. Using 'auto' instead." + ) + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.3.60/library/general/test/y2issues/issue_test.rb new/yast2-4.4.1/library/general/test/y2issues/issue_test.rb --- old/yast2-4.3.60/library/general/test/y2issues/issue_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-4.4.1/library/general/test/y2issues/issue_test.rb 2021-04-19 08:37:30.000000000 +0200 @@ -0,0 +1,64 @@ +#!/usr/bin/env rspec +# Copyright (c) [2021] 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 "y2issues" + +describe Y2Issues::Issue do + describe "#new" do + subject(:issue) do + described_class.new( + "Something went wrong", location: "file:/etc/hosts", severity: :fatal + ) + end + + it "creates an issue" do + expect(issue.message).to eq("Something went wrong") + expect(issue.location).to eq(Y2Issues::Location.parse("file:/etc/hosts")) + expect(issue.severity).to eq(:fatal) + end + + context "when a severity is not given" do + subject(:issue) { described_class.new("Something went wrong") } + + it "sets the severity to :warn" do + expect(issue.severity).to eq(:warn) + end + end + end + + describe "#fatal?" do + context "when severity is :fatal" do + subject(:issue) { described_class.new("Something went wrong", severity: :fatal) } + + it "returns true" do + expect(issue.fatal?).to eq(true) + end + end + + context "when severity is :fatal" do + subject(:issue) { described_class.new("Something went wrong", severity: :warn) } + + it "returns false" do + expect(issue.fatal?).to eq(false) + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.3.60/library/general/test/y2issues/list_test.rb new/yast2-4.4.1/library/general/test/y2issues/list_test.rb --- old/yast2-4.3.60/library/general/test/y2issues/list_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-4.4.1/library/general/test/y2issues/list_test.rb 2021-04-19 08:37:30.000000000 +0200 @@ -0,0 +1,75 @@ +#!/usr/bin/env rspec +# Copyright (c) [2021] 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 "y2issues" + +describe Y2Issues::List do + subject(:list) { described_class.new([issue]) } + + let(:issue) { Y2Issues::Issue.new("Something went wrong") } + + it "returns an array containing added issues" do + expect(list.to_a).to eq([issue]) + end + + describe "#to_a" do + context "when list is empty" do + subject(:list) { described_class.new([]) } + + it "returns an empty array" do + expect(list.to_a).to eq([]) + end + end + end + + describe "#empty?" do + context "when list is empty" do + subject(:list) { described_class.new([]) } + + it "returns true" do + expect(list).to be_empty + end + end + + context "when some issue was added" do + it "returns false" do + expect(list).to_not be_empty + end + end + end + + describe "#fatal?" do + context "when contains some fatal error" do + let(:issue) { Y2Issues::Issue.new("Something went wrong", severity: :fatal) } + + it "returns true" do + expect(list.fatal?).to eq(true) + end + end + + context "when does not contain any fatal error" do + it "returns false" do + expect(list.fatal?).to eq(false) + end + + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.3.60/library/general/test/y2issues/location_test.rb new/yast2-4.4.1/library/general/test/y2issues/location_test.rb --- old/yast2-4.3.60/library/general/test/y2issues/location_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-4.4.1/library/general/test/y2issues/location_test.rb 2021-04-19 08:37:30.000000000 +0200 @@ -0,0 +1,73 @@ +#!/usr/bin/env rspec +# Copyright (c) [2021] 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 "y2issues/location" + +describe Y2Issues::Location do + subject(:location) do + described_class.new("file", "/etc/hosts", "1") + end + + describe ".parse" do + it "returns a location with the given components" do + location = described_class.parse("file:/etc/hosts:1") + expect(location.type).to eq("file") + expect(location.path).to eq("/etc/hosts") + expect(location.id).to eq("1") + end + end + + describe "#==" do + context "when locations have the same values" do + let(:other) do + described_class.new("file", "/etc/hosts", "1") + end + + it "returns true" do + expect(location).to eq(other) + end + end + + context "when locations have different values" do + let(:other) do + described_class.new("file", "/etc/resolv.conf") + end + + it "returns true" do + expect(location).to_not eq(other) + end + end + end + + describe "#to_s" do + it "returns a string based representation of the location" do + expect(location.to_s).to eq("file:/etc/hosts:1") + end + + context "when the ID is missing" do + subject(:location) { described_class.new("file", "/etc/hosts") } + + it "does not include the ID" do + expect(location.to_s).to eq("file:/etc/hosts") + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.3.60/library/general/test/y2issues/presenter_test.rb new/yast2-4.4.1/library/general/test/y2issues/presenter_test.rb --- old/yast2-4.3.60/library/general/test/y2issues/presenter_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-4.4.1/library/general/test/y2issues/presenter_test.rb 2021-04-19 08:37:30.000000000 +0200 @@ -0,0 +1,61 @@ +#!/usr/bin/env rspec +# Copyright (c) [2021] 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 "y2issues" + +describe Y2Issues::Presenter do + subject(:presenter) { described_class.new(list) } + let(:list) { Y2Issues::List.new } + + describe "#to_html" do + context "when a fatal issue was found" do + before do + list << Y2Issues::Issue.new("Something is invalid", severity: :fatal) + end + + it "includes issues messages" do + issue = list.first + expect(presenter.to_html.to_s).to include "<li>#{issue.message}</li>" + end + + it "includes an introduction to fatal issues qlist" do + expect(presenter.to_html.to_s).to include "Important issues" + end + end + + context "when a non fatal issue was found" do + before do + list << Y2Issues::Issue.new("Something is missing", severity: :warn) + end + + it "includes issues messages" do + issue = list.first + expect(presenter.to_html.to_s).to include "<li>#{issue.message}</li>" + end + + it "includes an introduction to non fatal issues list" do + expect(presenter.to_html.to_s).to include "<p>Minor issues" + end + end + + it "groups elements from the same location" + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.3.60/library/general/test/y2issues/reporter_test.rb new/yast2-4.4.1/library/general/test/y2issues/reporter_test.rb --- old/yast2-4.3.60/library/general/test/y2issues/reporter_test.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/yast2-4.4.1/library/general/test/y2issues/reporter_test.rb 2021-04-19 08:37:30.000000000 +0200 @@ -0,0 +1,124 @@ +#!/usr/bin/env rspec +# Copyright (c) [2021] 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 "y2issues" + +describe Y2Issues::Reporter do + let(:reporter) { described_class.new(list, report_settings: report) } + let(:list) { Y2Issues::List.new([issue]) } + let(:issue) do + Y2Issues::Issue.new("Something went wrong", severity: level) + end + let(:report) do + { + "warnings" => warnings_settings, + "errors" => errors_settings + } + end + let(:warnings_settings) do + { "log" => true, "show" => true, "timeout" => 10 } + end + let(:errors_settings) do + { "log" => true, "show" => true, "timeout" => 15 } + end + let(:level) { :fatal } + + describe "#report" do + before do + allow(Yast2::Popup).to receive(:show) + end + + it "displays the list of issues" do + expect(Yast2::Popup).to receive(:show) + reporter.report + end + + context "when there is a fatal error" do + let(:level) { :fatal } + + it "displays issues as errors with no timeout" do + expect(Yast2::Popup).to receive(:show) .with( + /Important issues/, headline: :error, richtext: true, timeout: 0, + buttons: a_hash_including(abort: String) + ) + reporter.report + end + + it "logs the issues" do + expect(reporter.log).to receive(:error).with(/Important issues/) + reporter.report + end + + context "if showing errors is disabled" do + let(:errors_settings) { { "show" => false, "log" => true } } + + it "does not display the issues" do + expect(Yast2::Popup).to_not receive(:show) + reporter.report + end + end + + context "if loggin errors is disabled" do + let(:errors_settings) { { "show" => true, "log" => false } } + + it "does not log the error" do + expect(reporter.log).to_not receive(:error) + reporter.report + end + end + + context "when there are just warnings" do + let(:level) { :warn } + + it "displays issues as errors with no timeout" do + expect(Yast2::Popup).to receive(:show) .with( + /Minor issues/, headline: :warning, richtext: true, timeout: 10, + buttons: :yes_no + ) + reporter.report + end + + it "logs the issues" do + expect(reporter.log).to receive(:warn).with(/Minor issues/) + reporter.report + end + + context "if showing warnings is disabled" do + let(:warnings_settings) { { "show" => false, "log" => true } } + + it "does not display the issues" do + expect(Yast2::Popup).to_not receive(:show) + reporter.report + end + end + + context "if loggin warnings is disabled" do + let(:warnings_settings) { { "show" => true, "log" => false } } + + it "does not log the warning" do + expect(reporter.log).to_not receive(:warn) + reporter.report + end + end + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.3.60/package/yast2.changes new/yast2-4.4.1/package/yast2.changes --- old/yast2-4.3.60/package/yast2.changes 2021-03-29 14:49:41.000000000 +0200 +++ new/yast2-4.4.1/package/yast2.changes 2021-04-19 08:37:30.000000000 +0200 @@ -1,4 +1,23 @@ ------------------------------------------------------------------- +Fri Apr 16 12:03:50 UTC 2021 - Imobach Gonzalez Sosa <igonzalezs...@suse.com> + +- Add a mechanism to report issues to the user (related to + bsc#1181295). +- 4.4.1 + +------------------------------------------------------------------- +Wed Apr 14 12:09:49 UTC 2021 - Ladislav Slez??k <lsle...@suse.cz> + +- Updated manual page ("man yast2") (bsc#1184681) +- 4.4.0 + +------------------------------------------------------------------- +Mon Apr 12 15:12:41 UTC 2021 - Imobach Gonzalez Sosa <igonzalezs...@suse.com> + +- Add a default value for file_path argument in ::new and ::load + methods of CFA::LoginDefs class. + +------------------------------------------------------------------- Mon Mar 29 09:46:31 UTC 2021 - Imobach Gonzalez Sosa <igonzalezs...@suse.com> - Add a AbstractWidget#displayed? to determine whether diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.3.60/package/yast2.spec new/yast2-4.4.1/package/yast2.spec --- old/yast2-4.3.60/package/yast2.spec 2021-03-29 14:49:41.000000000 +0200 +++ new/yast2-4.4.1/package/yast2.spec 2021-04-19 08:37:30.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2 -Version: 4.3.60 +Version: 4.4.1 Release: 0 Summary: YaST2 Main Package License: GPL-2.0-only