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-05 23:31:21 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/yast2 (Old) and /work/SRC/openSUSE:Factory/.yast2.new.1898 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "yast2" Sat Jun 5 23:31:21 2021 rev:512 rq:897361 version:4.4.9 Changes: -------- --- /work/SRC/openSUSE:Factory/yast2/yast2.changes 2021-06-01 10:33:57.556455263 +0200 +++ /work/SRC/openSUSE:Factory/.yast2.new.1898/yast2.changes 2021-06-05 23:31:56.324480392 +0200 @@ -1,0 +2,28 @@ +Thu Jun 3 15:40:30 UTC 2021 - Jos?? Iv??n L??pez Gonz??lez <jlo...@suse.com> + +- AutoYaST: SectionWithAttributes allows to indicate whether an + attribute accepts blank values (related to jsc#PM-2620). +- 4.4.9 + +------------------------------------------------------------------- +Thu Jun 3 09:04:29 UTC 2021 - Josef Reidinger <jreidin...@suse.com> + +- revert disable of hibernation based on product and virtual + machines (bsc#1184470) +- 4.4.8 + +------------------------------------------------------------------- +Wed Jun 2 17:30:50 UTC 2021 - Knut Anderssen <kanders...@suse.com> + +- Improve Yast2::Equatable mixin making the #hash method to be fine + tuned easelly (related to bsc#11806082). +- 4.4.7 + +------------------------------------------------------------------- +Tue Jun 1 11:48:18 UTC 2021 - Ancor Gonzalez Sosa <an...@suse.com> + +- Added some names to the list of parameters handled by CFA for the + login.defs configuration (related to jsc#PM-2620). +- 4.4.6 + +------------------------------------------------------------------- Old: ---- yast2-4.4.5.tar.bz2 New: ---- yast2-4.4.9.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ yast2.spec ++++++ --- /var/tmp/diff_new_pack.WzjKGn/_old 2021-06-05 23:31:57.376482222 +0200 +++ /var/tmp/diff_new_pack.WzjKGn/_new 2021-06-05 23:31:57.376482222 +0200 @@ -17,7 +17,7 @@ Name: yast2 -Version: 4.4.5 +Version: 4.4.9 Release: 0 Summary: YaST2 Main Package License: GPL-2.0-only ++++++ yast2-4.4.5.tar.bz2 -> yast2-4.4.9.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.4.5/library/general/src/lib/cfa/login_defs.rb new/yast2-4.4.9/library/general/src/lib/cfa/login_defs.rb --- old/yast2-4.4.5/library/general/src/lib/cfa/login_defs.rb 2021-05-25 10:07:11.000000000 +0200 +++ new/yast2-4.4.9/library/general/src/lib/cfa/login_defs.rb 2021-06-04 10:57:39.000000000 +0200 @@ -46,23 +46,33 @@ # @return [Array<Symbol>] List of known login.defs attributes KNOWN_ATTRIBUTES = [ :character_class, + :create_home, :encrypt_method, :fail_delay, :gid_max, :gid_min, :groupadd_cmd, + :home_mode, :pass_max_days, :pass_min_days, :pass_warn_age, + :sub_gid_min, + :sub_gid_max, + :sub_gid_count, + :sub_uid_min, + :sub_uid_max, + :sub_uid_count, :sys_gid_max, :sys_gid_min, :sys_uid_max, :sys_uid_min, :uid_max, :uid_min, + :umask, :useradd_cmd, :userdel_postcmd, - :userdel_precmd + :userdel_precmd, + :usergroups_enab ].freeze DEFAULT_PATH = "/etc/login.defs".freeze diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.4.5/library/general/src/lib/installation/autoinst_profile/section_with_attributes.rb new/yast2-4.4.9/library/general/src/lib/installation/autoinst_profile/section_with_attributes.rb --- old/yast2-4.4.5/library/general/src/lib/installation/autoinst_profile/section_with_attributes.rb 2021-05-25 10:07:11.000000000 +0200 +++ new/yast2-4.4.9/library/general/src/lib/installation/autoinst_profile/section_with_attributes.rb 2021-06-04 10:57:39.000000000 +0200 @@ -1,4 +1,4 @@ -# Copyright (c) [2020] SUSE LLC +# Copyright (c) [2020-2021] SUSE LLC # # All Rights Reserved. # @@ -123,8 +123,14 @@ class << self # Description of the attributes in the section. # - # To be defined by each subclass. Each entry contains a hash with the - # mandatory key :name and an optional key :xml_name. + # To be defined by each subclass. Each entry contains a hash with: + # * :name : (mandatory) name of the attribute. + # * :xml_name : (optional) name of the attribute in the xml profile. This is useful + # when the attribute is required to be called different to the its xml + # name. + # * :allow_blank : (optional, false by default) whether blank values (i.e, "" or []) are + # allowed. If set to false, then the value of the attribute will be nil + # when a blank is detected. # # @return [Array<Hash>] def attributes @@ -194,10 +200,11 @@ # included. def to_hashes attributes.each_with_object({}) do |attrib, result| + key = attrib_key(attrib) value = attrib_value(attrib) - next if attrib_skip?(value) - key = attrib_key(attrib) + next if attrib_skip?(key, value) + result[key] = value end end @@ -258,10 +265,19 @@ self.class.attributes end + def attrib(key) + attributes.find { |a| a[:xml_name] == key.to_sym || a[:name] == key.to_sym } + end + # Whether an attribute must be skipped during import/export. # - # @return [Boolean] true is the value is blank - def attrib_skip?(value) + # @return [Boolean] true is the attribute allows to skip and its value is blank + def attrib_skip?(key, value) + attrib = attrib(key) + + return true unless attrib + return false if attrib[:allow_blank] + value.nil? || value == [] || value == "" end @@ -283,7 +299,7 @@ end def attrib_name(key) - attrib = attributes.detect { |a| a[:xml_name] == key.to_sym || a[:name] == key.to_sym } + attrib = attrib(key) return nil unless attrib attrib[:name] @@ -301,7 +317,7 @@ # This method only reads scalar values next if value.is_a?(Array) || value.is_a?(Hash) - if attrib_skip?(value) + if attrib_skip?(key, value) log.debug "Ignored blank value (#{value}) for #{key}" next end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.4.5/library/general/src/lib/yast2/equatable.rb new/yast2-4.4.9/library/general/src/lib/yast2/equatable.rb --- old/yast2-4.4.5/library/general/src/lib/yast2/equatable.rb 2021-05-25 10:07:11.000000000 +0200 +++ new/yast2-4.4.9/library/general/src/lib/yast2/equatable.rb 2021-06-04 10:57:39.000000000 +0200 @@ -82,13 +82,21 @@ end end + # Returns a Hash containing all the attributes and values used for comparing + # the objects as well as a :class key with the object class as the value. + # + # @return [Hash<Symbol, Object] + def eql_hash + ([[:class, self.class]] + self.class.eql_attrs.map { |m| [m, send(m)] }).to_h + 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 + eql_hash.hash end # Whether the objects have the same hash key diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.4.5/library/general/test/installation/autoinst_profile/section_with_attributes_test.rb new/yast2-4.4.9/library/general/test/installation/autoinst_profile/section_with_attributes_test.rb --- old/yast2-4.4.5/library/general/test/installation/autoinst_profile/section_with_attributes_test.rb 2021-05-25 10:07:11.000000000 +0200 +++ new/yast2-4.4.9/library/general/test/installation/autoinst_profile/section_with_attributes_test.rb 2021-06-04 10:57:39.000000000 +0200 @@ -1,4 +1,4 @@ -# Copyright (c) [2020] SUSE LLC +# Copyright (c) [2020-2021] SUSE LLC # # All Rights Reserved. # @@ -82,7 +82,8 @@ class << self def attributes [ - { name: :name } + { name: :name, allow_blank: true }, + { name: :other, allow_blank: false } ] end end @@ -105,6 +106,94 @@ expect(group.name).to eq("users") end + context "when an attribute allows blank" do + context "and the hash does not contain that key" do + let(:hash) { { other: "" } } + + it "assigns nil to the attribute" do + group = GroupSection.new_from_hashes(hash) + + expect(group.name).to be_nil + end + end + + context "and the hash contains that key" do + context "and the value for the key is nil" do + let(:hash) { { name: nil } } + + it "assigns nil to the attribute" do + group = GroupSection.new_from_hashes(hash) + + expect(group.name).to be_nil + end + end + + context "and the value for the key is blank" do + let(:hash) { { name: "" } } + + it "assigns blank to the attribute" do + group = GroupSection.new_from_hashes(hash) + + expect(group.name).to eq("") + end + end + + context "and the value for the key is not blank" do + let(:hash) { { name: "a name" } } + + it "assigns the given value to the attribute" do + group = GroupSection.new_from_hashes(hash) + + expect(group.name).to eq("a name") + end + end + end + end + + context "when an attribute does not allow blank" do + context "and the hash does not contain that key" do + let(:hash) { { name: "" } } + + it "assigns nil to the attribute" do + group = GroupSection.new_from_hashes(hash) + + expect(group.other).to be_nil + end + end + + context "and the hash contains that key" do + context "and the value for the key is nil" do + let(:hash) { { other: nil } } + + it "assigns nil to the attribute" do + group = GroupSection.new_from_hashes(hash) + + expect(group.other).to be_nil + end + end + + context "and the value for the key is blank" do + let(:hash) { { other: "" } } + + it "assigns nil to the attribute" do + group = GroupSection.new_from_hashes(hash) + + expect(group.other).to be_nil + end + end + + context "and the value for the key is not blank" do + let(:hash) { { other: "a name" } } + + it "assigns the given value to the attribute" do + group = GroupSection.new_from_hashes(hash) + + expect(group.other).to eq("a name") + end + end + end + end + context "when nil is given" do it "returns a instance" do group = GroupSection.new_from_hashes(nil) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.4.5/library/general/test/yast2/equatable_test.rb new/yast2-4.4.9/library/general/test/yast2/equatable_test.rb --- old/yast2-4.4.5/library/general/test/yast2/equatable_test.rb 2021-05-25 10:07:11.000000000 +0200 +++ new/yast2-4.4.9/library/general/test/yast2/equatable_test.rb 2021-06-04 10:57:39.000000000 +0200 @@ -144,4 +144,30 @@ end end end + + describe "#eql_hash" 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) } + + it "returns a Hash containing the :class key and the object class as the value" do + expect(subject.eql_hash).to include(class: subject.class) + end + + it "returns a Hash with the comparing attributes and their values" do + expect(subject.eql_hash).to include(attr1: "a", attr2: 10) + end + end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.4.5/library/system/src/modules/Kernel.rb new/yast2-4.4.9/library/system/src/modules/Kernel.rb --- old/yast2-4.4.5/library/system/src/modules/Kernel.rb 2021-05-25 10:07:11.000000000 +0200 +++ new/yast2-4.4.9/library/system/src/modules/Kernel.rb 2021-06-04 10:57:39.000000000 +0200 @@ -558,10 +558,6 @@ def propose_hibernation? # Do not support s390. (jsc#SLE-6926) return false unless Arch.i386 || Arch.x86_64 - # Do not propose resume on virtuals (jsc#SLE-12280) - return false if Arch.is_virtual - # For some products it does not make sense to have hibernations (jsc#SLE-12280) - return false unless ProductFeatures.GetBooleanFeature("globals", "propose_hibernation") true end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.4.5/library/system/test/kernel_test.rb new/yast2-4.4.9/library/system/test/kernel_test.rb --- old/yast2-4.4.5/library/system/test/kernel_test.rb 2021-05-25 10:07:11.000000000 +0200 +++ new/yast2-4.4.9/library/system/test/kernel_test.rb 2021-06-04 10:57:39.000000000 +0200 @@ -246,42 +246,8 @@ allow(Yast::Arch).to receive(:architecture).and_return("x86_64") end - context "on virtual machine" do - before do - allow(Yast::Arch).to receive(:is_virtual).and_return(true) - end - - it "returns false" do - expect(subject.propose_hibernation?).to eq false - end - end - - context "on real hardware" do - before do - allow(Yast::Arch).to receive(:is_virtual).and_return(false) - end - - context "when product does not want hibernation proposal" do - before do - allow(Yast::ProductFeatures).to receive(:GetBooleanFeature) - .with("globals", "propose_hibernation").and_return(false) - end - - it "returns false" do - expect(subject.propose_hibernation?).to eq false - end - end - - context "when product wants hibernation proposal" do - before do - allow(Yast::ProductFeatures).to receive(:GetBooleanFeature) - .with("globals", "propose_hibernation").and_return(true) - end - - it "returns true" do - expect(subject.propose_hibernation?).to eq true - end - end + it "returns true" do + expect(subject.propose_hibernation?).to eq true end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.4.5/package/yast2.changes new/yast2-4.4.9/package/yast2.changes --- old/yast2-4.4.5/package/yast2.changes 2021-05-25 10:07:11.000000000 +0200 +++ new/yast2-4.4.9/package/yast2.changes 2021-06-04 10:57:39.000000000 +0200 @@ -1,4 +1,32 @@ ------------------------------------------------------------------- +Thu Jun 3 15:40:30 UTC 2021 - Jos?? Iv??n L??pez Gonz??lez <jlo...@suse.com> + +- AutoYaST: SectionWithAttributes allows to indicate whether an + attribute accepts blank values (related to jsc#PM-2620). +- 4.4.9 + +------------------------------------------------------------------- +Thu Jun 3 09:04:29 UTC 2021 - Josef Reidinger <jreidin...@suse.com> + +- revert disable of hibernation based on product and virtual + machines (bsc#1184470) +- 4.4.8 + +------------------------------------------------------------------- +Wed Jun 2 17:30:50 UTC 2021 - Knut Anderssen <kanders...@suse.com> + +- Improve Yast2::Equatable mixin making the #hash method to be fine + tuned easelly (related to bsc#11806082). +- 4.4.7 + +------------------------------------------------------------------- +Tue Jun 1 11:48:18 UTC 2021 - Ancor Gonzalez Sosa <an...@suse.com> + +- Added some names to the list of parameters handled by CFA for the + login.defs configuration (related to jsc#PM-2620). +- 4.4.6 + +------------------------------------------------------------------- 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 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yast2-4.4.5/package/yast2.spec new/yast2-4.4.9/package/yast2.spec --- old/yast2-4.4.5/package/yast2.spec 2021-05-25 10:07:11.000000000 +0200 +++ new/yast2-4.4.9/package/yast2.spec 2021-06-04 10:57:39.000000000 +0200 @@ -17,7 +17,7 @@ Name: yast2 -Version: 4.4.5 +Version: 4.4.9 Release: 0 Summary: YaST2 Main Package License: GPL-2.0-only