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-06-01 10:33:46
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2 (Old)
 and      /work/SRC/openSUSE:Factory/.yast2.new.1898 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2"

Tue Jun  1 10:33:46 2021 rev:511 rq:895495 version:4.4.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2/yast2.changes      2021-05-07 
16:45:47.664279006 +0200
+++ /work/SRC/openSUSE:Factory/.yast2.new.1898/yast2.changes    2021-06-01 
10:33:57.556455263 +0200
@@ -1,0 +2,15 @@
+Tue May 25 07:19:14 UTC 2021 - Jos?? Iv??n L??pez Gonz??lez <jlo...@suse.com>
+
+- Add Yast2::Equatable mixin to avoid troubles with classes that
+  overloads the comparison methods (related to bsc#1186082).
+- 4.4.5
+
+-------------------------------------------------------------------
+Fri May  7 15:10:14 UTC 2021 - Stefan Schubert <sch...@suse.de>
+
+- Logging all available product information into directory
+  /var/log/YaST2/installation_info. This should help for evaluating the
+  cause of e.g. bsc#1180888, bsc#1180908, bsc#1178688.
+- 4.4.4
+
+-------------------------------------------------------------------

Old:
----
  yast2-4.4.3.tar.bz2

New:
----
  yast2-4.4.5.tar.bz2

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ yast2.spec ++++++
--- /var/tmp/diff_new_pack.0PiK2U/_old  2021-06-01 10:33:58.200456360 +0200
+++ /var/tmp/diff_new_pack.0PiK2U/_new  2021-06-01 10:33:58.200456360 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2
-Version:        4.4.3
+Version:        4.4.5
 Release:        0
 Summary:        YaST2 Main Package
 License:        GPL-2.0-only

++++++ yast2-4.4.3.tar.bz2 -> yast2-4.4.5.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-4.4.3/library/general/src/data/country.ycp 
new/yast2-4.4.5/library/general/src/data/country.ycp
--- old/yast2-4.4.3/library/general/src/data/country.ycp        2021-05-05 
12:48:16.000000000 +0200
+++ new/yast2-4.4.5/library/general/src/data/country.ycp        2021-05-25 
10:07:11.000000000 +0200
@@ -57,7 +57,6 @@
     "EC" : _("Ecuador"),
     "EE" : _("Estonia"),
     "EG" : _("Egypt"),
-    "ES" : _("Catalonia"),
     "ES" : _("Spain"),
     "FI" : _("Finland"),
     "FO" : _("Faroe Islands"),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-4.4.3/library/general/src/data/country_long.ycp 
new/yast2-4.4.5/library/general/src/data/country_long.ycp
--- old/yast2-4.4.3/library/general/src/data/country_long.ycp   2021-05-05 
12:48:16.000000000 +0200
+++ new/yast2-4.4.5/library/general/src/data/country_long.ycp   2021-05-25 
10:07:11.000000000 +0200
@@ -53,7 +53,7 @@
     "bn_BD" : _("Bangladesh"),
     "br_FR" : _("France"),
     "bs_BA" : _("Bosnia and Herzegowina"),
-    "ca_ES" : _("Catalonia"),
+    "ca_ES" : _("Spain"),
     "cs_CZ" : _("Czech Republic"),
     "cy_GB" : _("Great Britain"),
     "da_DK" : _("Denmark"),
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-4.4.3/library/general/src/lib/installation/installation_info.rb 
new/yast2-4.4.5/library/general/src/lib/installation/installation_info.rb
--- old/yast2-4.4.3/library/general/src/lib/installation/installation_info.rb   
1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-4.4.5/library/general/src/lib/installation/installation_info.rb   
2021-05-25 10:07:11.000000000 +0200
@@ -0,0 +1,129 @@
+# 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 "singleton"
+require "yaml"
+
+require "yast"
+
+module Installation
+  #
+  # Class which collects all installation/update information in order
+  # to write it into the /var/log/YaST2/installation_info directory
+  # when the process has been finished correctly or the process has
+  # crashed.
+  #
+  # The implementation uses a callback mechanism to allow easily extending the
+  # logged data, it avoids circular dependencies between packages and easily 
handles
+  # optional YaST modules (e.g. the registration module is not present in the
+  # openSUSE Leap installer).
+  #
+  # The callbacks also ensure that we really log the current values at the time
+  # of writing the dump file.
+  #
+  # @example Registering a custom callback
+  # ::Installation::InstallationInfo.instance.add_callback("my_module") do
+  #   {
+  #     "foo" => foo.value,
+  #     "bar" => bar.value
+  #   }
+  # end
+  #
+  # @example Dumping the data when an error occurs
+  # if failed
+  #   ::Installation::InstallationInfo.instance.write(
+  #     "Setting foo option failed",
+  #     additional_info: "File foo does not exist"
+  #   )
+  # end
+  class InstallationInfo
+    include Singleton
+    include Yast::Logger
+
+    LOGDIR = "/var/log/YaST2/installation_info/".freeze
+
+    include Yast::Logger
+
+    def initialize
+      # index of the saved file to have unique file names
+      self.index = 0
+
+      # Function calls which has been set by other modules,
+      # these functions will be called while generating the output.
+      # The return value (usually a Hash) of each call will be logged into the 
output file.
+      # Uses "id" => block mapping
+      @callbacks = {}
+    end
+
+    # Register a block which will be called while generating the data file.
+    #
+    # @param name [String] id of the function call, using the same id
+    #   will overwrite the previous setting, use the module/package name
+    #   to avoid conflicts
+    def add_callback(name, &block)
+      return unless block_given?
+
+      log.info("Adding callback #{name.inspect}")
+      callbacks[name] = block
+    end
+
+    # is the callback already registered?
+    # @param name [String] name of the callback
+    # @return [Boolean] `true` if registered, `false` otherwise
+    def callback?(name)
+      callbacks.key?(name)
+    end
+
+    # Collects the data and writes the dump into an YAML file.
+    #
+    # @param description [String] description of data, e.g. what happened
+    # @param additional_info [Object] optional additional information
+    # @param path [String,nil] path to the saved dump file,
+    #   uses the default path if `nil`
+    # @return [String] path to the written file
+    def write(description, additional_info: nil, path: nil)
+      file = path || File.join(LOGDIR, "dump_#{Process.pid}_#{format("%03d", 
index)}.yml")
+      log.info("Writing installation information to #{file}")
+
+      # the collected data
+      data = {
+        "description" => description
+      }
+
+      data["additional_info"] = additional_info if additional_info
+
+      @callbacks.each do |name, callback|
+        data[name] = callback.call
+      end
+
+      ::FileUtils.mkdir_p(File.dirname(file))
+      File.write(file, data.to_yaml)
+
+      # increase the file counter for the next file
+      self.index += 1
+
+      file
+    end
+
+  protected
+
+    attr_reader :callbacks
+    attr_accessor :index
+  end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-4.4.3/library/general/src/lib/yast2/equatable.rb 
new/yast2-4.4.5/library/general/src/lib/yast2/equatable.rb
--- old/yast2-4.4.3/library/general/src/lib/yast2/equatable.rb  1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-4.4.5/library/general/src/lib/yast2/equatable.rb  2021-05-25 
10:07:11.000000000 +0200
@@ -0,0 +1,104 @@
+# 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 Yast2
+  # Mixin for classes that require to define a custom comparison
+  #
+  # By default, the methods #==, #eql? and #equal? in Object subclasses return 
true if both objects
+  # are the same (point to the same object in memory). Actually #eql? should 
return true if both
+  # objects refer to the same hash key. But in practice, two objects have the 
same hash key if they
+  # are the very same object. There are some exceptions like String, which 
returns the same hash key
+  # if they have the same value.
+  #
+  # The #eql? and #hash methods must be related. That is, if two objects are 
#eql?, then they should
+  # have the same #hash. This is important, otherwise we could have unexpected 
results in certain
+  # operations like subtracting Arrays. When performing the difference of two 
Arrays, the method
+  # used for comparing the objects in the Array depends on the Array length 
(see source code of
+  # Array#difference). If both Arrays have more than SMALL_ARRAY_LEN (i.e., 
16) elements, then
+  # the #hash method is used. Otherwise it uses #eql?. This is one of the 
reason why #eql? and #hash
+  # should be paired.
+  #
+  # @example
+  #   class Foo
+  #     include Equatable
+  #
+  #     attr_reader :attr1, :attr2
+  #
+  #     eql_attr :attr1
+  #
+  #     def initialize(attr1, attr2)
+  #       @attr1 = attr1
+  #       @attr2 = attr2
+  #     end
+  #   end
+  #
+  #   foo1 = Foo.new("a", "b")
+  #   foo2 = Foo.new("a", "c")
+  #
+  #   foo1 == foo2      #=> true
+  #   foo1.eql?(foo2)   #=> true
+  #   foo1.equal?(foo2) #=> false
+  module Equatable
+    def self.included(base)
+      base.extend(ClassMethods)
+    end
+
+    # Class methods for defining the attributes to consider when comparing 
objects
+    module ClassMethods
+      # Inherited classes must remember the attributes for comparison from its 
parent class
+      def inherited(subclass)
+        subclass.eql_attr(*eql_attrs)
+      end
+
+      # Name of the attributes to consider when comparing objects
+      #
+      # @return [Array<Symbol>]
+      def eql_attrs
+        @eql_attrs || []
+      end
+
+      # Saves the name of the attributes to use when comparing objects
+      #
+      # @param names [Array<Symbol>]
+      def eql_attr(*names)
+        @eql_attrs ||= []
+        @eql_attrs += names
+      end
+    end
+
+    # Hash key to identify objects
+    #
+    # Objects with the same values for their eql_attrs have the same hash
+    #
+    # @return [Integer]
+    def hash
+      ([[:class, self.class]] + self.class.eql_attrs.map { |m| [m, send(m)] 
}).to_h.hash
+    end
+
+    # Whether the objects have the same hash key
+    #
+    # @param other [Object]
+    # @return [Boolean]
+    def eql?(other)
+      hash == other.hash
+    end
+
+    alias_method :==, :eql?
+  end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-4.4.3/library/general/test/installation/installation_info_test.rb 
new/yast2-4.4.5/library/general/test/installation/installation_info_test.rb
--- old/yast2-4.4.3/library/general/test/installation/installation_info_test.rb 
1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-4.4.5/library/general/test/installation/installation_info_test.rb 
2021-05-25 10:07:11.000000000 +0200
@@ -0,0 +1,79 @@
+require "tempfile"
+require "yaml"
+
+require_relative "../test_helper"
+require "installation/installation_info"
+
+describe Installation::InstallationInfo do
+  # create a new anonymous subclass inheriting from the singleton class,
+  # this ensures we use a fresh instance for each test and we do not modify
+  # the global singleton instance
+  subject { Class.new(Installation::InstallationInfo).instance }
+
+  describe "#add_callback" do
+    it "remembers the callback block" do
+      expect { subject.add_callback("test") { puts "foo" } }.to change { 
subject.callback?("test") }
+        .from(false).to(true)
+    end
+
+    it "does not save missing block" do
+      subject.add_callback("test")
+
+      expect(subject.callback?("test")).to eq(false)
+    end
+  end
+
+  describe "#callback?" do
+    it "returns true for a defined callback name" do
+      subject.add_callback("test") { puts "foo" }
+
+      expect(subject.callback?("test")).to eq(true)
+    end
+
+    it "returns false for an undefined callback name" do
+      expect(subject.callback?("foo")).to eq(false)
+    end
+  end
+
+  describe "#write" do
+    before do
+      allow(File).to receive(:write)
+      allow(FileUtils).to receive(:mkdir_p)
+    end
+
+    it "evaluates all callbacks" do
+      foo = false
+      bar = false
+      subject.add_callback("foo") { foo = true }
+      subject.add_callback("bar") { bar = true }
+
+      subject.write("test")
+
+      expect(foo).to eq(true)
+      expect(bar).to eq(true)
+    end
+
+    it "saves the data to an YAML file" do
+      # unmock the File.write call
+      allow(File).to receive(:write).and_call_original
+
+      # write to a tempfile
+      tmpfile = Tempfile.new
+      begin
+        subject.write("test", path: tmpfile)
+
+        # check the file is not empty
+        expect(File.stat(tmpfile).size).to be > 0
+
+        # it can be parsed without errors
+        data = nil
+        expect { data = YAML.load_file(tmpfile) }.to_not raise_error
+
+        # expected data structure
+        expect(data).to be_a Hash
+      ensure
+        tmpfile.unlink
+      end
+    end
+  end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-4.4.3/library/general/test/yast2/equatable_test.rb 
new/yast2-4.4.5/library/general/test/yast2/equatable_test.rb
--- old/yast2-4.4.3/library/general/test/yast2/equatable_test.rb        
1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-4.4.5/library/general/test/yast2/equatable_test.rb        
2021-05-25 10:07:11.000000000 +0200
@@ -0,0 +1,147 @@
+#!/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 "yast2/equatable"
+
+describe Yast2::Equatable do
+  describe ".eql_attrs" do
+    class EquatableTest1
+      include Yast2::Equatable
+    end
+
+    context "when no attributes have been added for comparison" do
+      it "returns an empty list" do
+        expect(EquatableTest1.eql_attrs).to be_empty
+      end
+    end
+
+    context "when some attributes have been added for comparison" do
+      before do
+        EquatableTest1.eql_attr :foo, :bar
+      end
+
+      it "returns a list with the name of the attributes for comparison" do
+        expect(EquatableTest1.eql_attrs).to contain_exactly(:foo, :bar)
+      end
+    end
+  end
+
+  describe "#eql?" do
+    class EquatableTest
+      include Yast2::Equatable
+
+      attr_reader :attr1, :attr2, :attr3
+
+      eql_attr :attr1, :attr2
+
+      def initialize(attr1, attr2, attr3)
+        @attr1 = attr1
+        @attr2 = attr2
+        @attr3 = attr3
+      end
+    end
+
+    subject { EquatableTest.new("a", 10, :foo) }
+
+    context "when giving the same object" do
+      let(:other) { subject }
+
+      it "returns true" do
+        expect(subject.eql?(other)).to eq(true)
+      end
+    end
+
+    context "when giving an object of the same class" do
+      context "and the attributes for comparison are equal" do
+        let(:other) { EquatableTest.new("a", 10, :other) }
+
+        it "returns true" do
+          expect(subject.eql?(other)).to eq(true)
+        end
+      end
+
+      context "and any of the attributes for comparison is not equal" do
+        let(:other) { EquatableTest.new("b", 10, :other) }
+
+        it "returns false" do
+          expect(subject.eql?(other)).to eq(false)
+        end
+      end
+    end
+
+    context "when giving an object of another class" do
+      let(:other) { "Another class" }
+
+      it "returns false" do
+        expect(subject.eql?(other)).to eq(false)
+      end
+    end
+
+    context "with a subclass object" do
+      class EquatableTestDerived < EquatableTest; end
+
+      subject { EquatableTestDerived.new("a", 10, :foo) }
+
+      context "when comparing with a parent class object" do
+        let(:other) { EquatableTest.new("a", 10, :foo) }
+
+        it "returns false" do
+          expect(subject.eql?(other)).to eq(false)
+        end
+      end
+
+      context "when adding more attributes for comparison" do
+        class EquatableTestDerived
+          eql_attr :attr3
+        end
+
+        context "and any of the parent attributes for comparison is not equal" 
do
+          let(:other) { EquatableTestDerived.new("a", 11, :foo) }
+
+          it "returns false" do
+            expect(subject.eql?(other)).to eq(false)
+          end
+        end
+
+        context "and the parent attributes for comparison are equal" do
+          let(:other) { EquatableTestDerived.new("a", 10, attr3) }
+
+          context "but the new attributes for comparison are not equal" do
+            let(:attr3) { :bar }
+
+            it "returns false" do
+              expect(subject.eql?(other)).to eq(false)
+            end
+          end
+
+          context "and the new attributes for comparison are equal" do
+            let(:attr3) { :foo }
+
+            it "returns true" do
+              expect(subject.eql?(other)).to eq(true)
+            end
+          end
+        end
+      end
+    end
+  end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-4.4.3/library/packages/src/modules/Product.rb 
new/yast2-4.4.5/library/packages/src/modules/Product.rb
--- old/yast2-4.4.3/library/packages/src/modules/Product.rb     2021-05-05 
12:48:16.000000000 +0200
+++ new/yast2-4.4.5/library/packages/src/modules/Product.rb     2021-05-25 
10:07:11.000000000 +0200
@@ -29,6 +29,7 @@
 require "yast"
 require "y2packager/product_reader"
 require "y2packager/resolvable"
+require "installation/installation_info"
 
 module Yast
   class ProductClass < Module
@@ -126,6 +127,11 @@
 
       if products.empty?
         log.error "No base product found"
+        # Logging all information about the product evaluation
+        ::Installation::InstallationInfo.instance.write(
+          "No base product found",
+          additional_info: { "required_product_status" => required_status }
+        )
         raise "No base product found"
       elsif products.size > 1
         log.warn "More than one base product found!"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-4.4.3/library/packages/test/product_test.rb 
new/yast2-4.4.5/library/packages/test/product_test.rb
--- old/yast2-4.4.3/library/packages/test/product_test.rb       2021-05-05 
12:48:16.000000000 +0200
+++ new/yast2-4.4.5/library/packages/test/product_test.rb       2021-05-25 
10:07:11.000000000 +0200
@@ -290,6 +290,7 @@
       it "reports that no base product was found" do
         allow(Yast::Stage).to receive(:stage).and_return("initial")
         allow(Yast::Mode).to receive(:mode).and_return("installation")
+        allow_any_instance_of(Installation::InstallationInfo).to 
receive(:write)
 
         SUPPORTED_METHODS.each do |method_name|
           Yast.y2milestone "Yast::Product.#{method_name}"
@@ -307,6 +308,7 @@
       it "reports that no base product was found" do
         allow(Yast::Stage).to receive(:stage).and_return("normal")
         allow(Yast::Mode).to receive(:mode).and_return("normal")
+        allow_any_instance_of(Installation::InstallationInfo).to 
receive(:write)
 
         SUPPORTED_METHODS.each do |method_name|
           Yast.y2milestone "Yast::Product.#{method_name}"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-4.4.3/package/yast2.changes 
new/yast2-4.4.5/package/yast2.changes
--- old/yast2-4.4.3/package/yast2.changes       2021-05-05 12:48:16.000000000 
+0200
+++ new/yast2-4.4.5/package/yast2.changes       2021-05-25 10:07:11.000000000 
+0200
@@ -1,4 +1,19 @@
 -------------------------------------------------------------------
+Tue May 25 07:19:14 UTC 2021 - Jos?? Iv??n L??pez Gonz??lez <jlo...@suse.com>
+
+- Add Yast2::Equatable mixin to avoid troubles with classes that
+  overloads the comparison methods (related to bsc#1186082).
+- 4.4.5
+
+-------------------------------------------------------------------
+Fri May  7 15:10:14 UTC 2021 - Stefan Schubert <sch...@suse.de>
+
+- Logging all available product information into directory
+  /var/log/YaST2/installation_info. This should help for evaluating the
+  cause of e.g. bsc#1180888, bsc#1180908, bsc#1178688.
+- 4.4.4
+
+-------------------------------------------------------------------
 Mon May  3 14:35:49 UTC 2021 - David Diaz <dgonza...@suse.com>
 
 - Do not crash when a client execution return false
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-4.4.3/package/yast2.spec 
new/yast2-4.4.5/package/yast2.spec
--- old/yast2-4.4.3/package/yast2.spec  2021-05-05 12:48:16.000000000 +0200
+++ new/yast2-4.4.5/package/yast2.spec  2021-05-25 10:07:11.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2
-Version:        4.4.3
+Version:        4.4.5
 Release:        0
 Summary:        YaST2 Main Package
 License:        GPL-2.0-only

Reply via email to