Hello community,

here is the log from the commit of package yast2 for openSUSE:Factory checked 
in at 2019-10-16 09:09:40
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2 (Old)
 and      /work/SRC/openSUSE:Factory/.yast2.new.2352 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2"

Wed Oct 16 09:09:40 2019 rev:462 rq:736429 version:4.2.27

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2/yast2.changes      2019-09-30 
15:53:35.818143066 +0200
+++ /work/SRC/openSUSE:Factory/.yast2.new.2352/yast2.changes    2019-10-16 
09:09:41.848331649 +0200
@@ -1,0 +2,19 @@
+Wed Oct  9 08:02:32 UTC 2019 - Ladislav Slezák <[email protected]>
+
+- Fixed evaluating the available package versions, fixed crash
+  when trying to download a non-existing package (bsc#1151824)
+- 4.2.27
+
+-------------------------------------------------------------------
+Mon Oct  7 16:00:09 UTC 2019 - Imobach Gonzalez Sosa <[email protected]>
+
+- Remove old values from /etc/sysctl.conf (jsc#SLE-9077).
+- 4.2.26
+
+-------------------------------------------------------------------
+Thu Oct  3 12:31:35 UTC 2019 - Imobach Gonzalez Sosa <[email protected]>
+
+- Add a CFA based class to adjust sysctl settings (jsc#SLE-9077).
+- 4.2.25
+
+-------------------------------------------------------------------

Old:
----
  yast2-4.2.24.tar.bz2

New:
----
  yast2-4.2.27.tar.bz2

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

Other differences:
------------------
++++++ yast2.spec ++++++
--- /var/tmp/diff_new_pack.Y5QvEv/_old  2019-10-16 09:09:42.296330495 +0200
+++ /var/tmp/diff_new_pack.Y5QvEv/_new  2019-10-16 09:09:42.296330495 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2
-Version:        4.2.24
+Version:        4.2.27
 Release:        0
 Summary:        YaST2 Main Package
 License:        GPL-2.0-only
@@ -38,6 +38,8 @@
 BuildRequires:  rubygem(%{rb_default_ruby_abi}:abstract_method)
 # for file access using augeas
 BuildRequires:  rubygem(%{rb_default_ruby_abi}:cfa)
+# for used augeas lenses
+BuildRequires:  augeas-lenses
 # for running scripts
 BuildRequires:  update-desktop-files
 BuildRequires:  rubygem(%{rb_default_ruby_abi}:cheetah)
@@ -72,6 +74,8 @@
 Requires:       rubygem(%{rb_default_ruby_abi}:abstract_method)
 # for file access using augeas
 Requires:       rubygem(%{rb_default_ruby_abi}:cfa)
+# for used augeas lenses
+Requires:       augeas-lenses
 # For converting to/from punycode strings
 Requires:       sysconfig >= 0.80.0
 Requires:       rubygem(%{rb_default_ruby_abi}:simpleidn)

++++++ yast2-4.2.24.tar.bz2 -> yast2-4.2.27.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-4.2.24/doc/etc-and-usr-etc.md 
new/yast2-4.2.27/doc/etc-and-usr-etc.md
--- old/yast2-4.2.24/doc/etc-and-usr-etc.md     1970-01-01 01:00:00.000000000 
+0100
+++ new/yast2-4.2.27/doc/etc-and-usr-etc.md     2019-10-09 11:00:07.000000000 
+0200
@@ -0,0 +1,93 @@
+# Adding Support for the `/etc` + `/usr/etc` Layout
+
+## About
+
+This document tries to summarize our findings about the proposal to split the 
configuration files
+into `/usr/etc` (vendor) and `/etc` (user) directories. As you may know, YaST 
reads and writes
+information to many files under `/etc`, so we need to find a way to cope with 
this (future) layout.
+
+## How to Read the Configuration
+
+In the future, it is expected that vendor configuration files live under 
`/usr/etc` and user
+configuration is placed in `/etc`. Given a `example` application, the rules to 
determine the
+configuration are:
+
+* If `/etc/example.conf` does not exist, read `/usr/etc/example.conf`, 
`/usr/etc/example.d/*.conf`
+  and, finally, `/etc/example.d/*.conf`. The latter has precedence.
+* If `/etc/example.conf` does exist, just ignore the configuration under 
`/usr/etc` and consider
+  `/etc/example.conf` and `/etc/example.d/*.conf` only.
+
+YaST will merge settings from those files.
+
+## Impact in YaST
+
+When it comes to reading or writing configuration files, YaST uses mainly two 
different mechanisms:
+
+* The new 
[config_files_api](https://github.com/config-files-api/config_files_api) 
(a.k.a. CFA) API.
+* The [good old agents](https://github.com/yast/yast-core/), which are spread 
through all YaST
+  codebase (search for `.scr`) files.
+
+It means that we need to adapt CFA classes and agents to the new scenario. The 
next section proposes
+a simple solution which we have just implemented to handle modifications to 
`sysctl` settings and,
+the last one, proposes a complex but more general solution.
+
+## A Simple Solution for `sysctl.conf`
+
+In a nutshell, jsc#SLE-9077 states that `/etc/sysctl.conf` should not be 
modified.  So if you want
+to modify any `sysctl` setting, you should drop a file in `/etc/sysctl.d` 
containing the new values.
+
+As a first step, we have added a {Yast2::CFA::Sysctl} class which offers an 
API to sysctl settings.
+This new class uses `/etc/sysctl.d/30-yast.conf` instead of `/etc/sysctl.conf` 
to write the configuration.
+Moreover, it updates known keys that are present in the original 
`/etc/sysctl.conf` to avoid confusion.
+
+## An Elaborated Proposal
+
+### Extending CFA
+
+CFA offers an object-oriented way to read and write configuration files and, 
nowadays, it is used
+for `zypp.conf`, `chrony.conf`, `ifroute-*` and `ifcfg-*` files, etc. CFA is 
built around these abstractions:
+
+* **File handlers* provide access to files. By default, it simply uses the 
`File` class, but it can
+  be replaced with other mechanisms to allow, e.g., accessing over the 
network. Actually, YaST uses
+  a specific class,
+  
[TargetFile](https://github.com/yast/yast-yast2/blob/4efda93ac2221591965450570aa9a9dfad790132/library/system/src/lib/yast2/target_file.rb#L51),
+  which respects {Yast::Installation.destdir}. See the discussion about 
supporting agents to find
+  another use case.
+* *Parsers* analyze and extract configuration from files. Usually, CFA parsers 
use Augeas under the
+  hood.
+* *Models* offer an object-oriented API to a access a configuration file.
+
+Usually, a model is meant to represent a configuration file, but in a layout 
where the configuration
+is spread through several files, this approach could be pretty inconvenient. 
So, in order to support
+the new layout, we are introducing a new layer that abstracts the details of 
merging and building
+the model instance.
+
+The new `loader` classes offer an API to `#load` and `#save` the configuration 
files. On the one
+hand, the default loader (`Loader` class) would read the information from a 
single file. On the
+other hand, an alternative loader (`VendorLoader`) would build the 
configuration model by reading
+vendor and user settings.
+
+When it comes to writing the changes, the `VendorLoader` class will write 
changes to the `.d`
+directory if it exists.
+
+At this point in time, you can check a proof-of-concept in
+[config-files-api/config_files_api#32](https://github.com/config-files-api/config_files_api/pull/32).
+
+### Adapting the Agents
+
+Agents are used through all YaST code to read/write configuration settings. In 
order to support the
+new layout, we could follow (at least) these approaches:
+
+* Extend [agents](https://github.com/yast/yast-core/) to support 
reading/writing from/to different
+  files. At least `any`, `ini` and `modules` would need to be adapted.
+* Extend CFA to support reading/writing information from agents. It can be 
done by creating a
+  specific *file handler* for agents. See [yast/yast-yast2 usr-etc-support
+  branch](https://github.com/yast/yast-yast2/compare/usr-etc-support?expand=1) 
for a
+  proof-of-concept.
+
+At first sight, extending the agents should minimize the changes through YaST 
codebase. However,
+although extending CFA would require more work, it would force us to adapt a 
CFA based approach to
+handle the configuration.
+
+Finally, the `non-y2` agent handles a few scripts that we should consider in a 
case by case basis
+(search for `servers_non_y2`).
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-4.2.24/library/general/src/lib/cfa/sysctl.rb 
new/yast2-4.2.27/library/general/src/lib/cfa/sysctl.rb
--- old/yast2-4.2.24/library/general/src/lib/cfa/sysctl.rb      1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-4.2.27/library/general/src/lib/cfa/sysctl.rb      2019-10-09 
11:00:07.000000000 +0200
@@ -0,0 +1,154 @@
+# 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 "yast"
+require "cfa/base_model"
+require "yast2/target_file"
+
+module CFA
+  # CFA based API to adjust the sysctl tool configuration
+  #
+  # This class does not modify the running kernel configuration. It just writes
+  # the desired values into the configuration file ({PATH}).
+  #
+  # @example Enabling IPv4 forwarding
+  #   sysctl = Sysctl.new
+  #   sysctl.forward_ipv4 = true
+  #   sysctl.save
+  #
+  # Although in the previous example we enabled the IPv4 forwarding using by
+  # setting +forward_ipv4+ to true. However, under the hood, the kernel maps
+  # boolean values to "1" or "0". If you want to access to that raw value,
+  # you can prepend "raw_" to the method's name.
+  #
+  # @example Accessing the raw value of a setting
+  #   sysctl = Sysctl.new
+  #   sysctl.load
+  #   sysctl.raw_forward_ipv6 #=> "0"
+  #   sysctl.raw_forward_ipv6 = "1"
+  #   sysctl.forward_ipv6? #=> true
+  class Sysctl < BaseModel
+    include Yast::Logger
+
+    PARSER = AugeasParser.new("sysctl.lns")
+    PATH = "/etc/sysctl.d/30-yast.conf".freeze
+
+    class << self
+      # Modifies default CFA methods to handle boolean values
+      #
+      # When getting or setting the value, a boolean value will be expected. 
Under the hood, it will
+      # be translated into "1" or "0". Additionally, to access to the raw 
value ("1", "0" or +nil+),
+      # just prepend "raw_" to the name of the method. Bear in mind that if 
the raw value is +nil+,
+      # it will be considered +false+.
+      #
+      # @param attrs [Array<Symbol>] Attribute name
+      def boolean_attr(*attrs)
+        attrs.each do |attr|
+          raw_attr = "raw_#{attr}"
+          alias_method raw_attr, attr
+          define_method attr do
+            public_send(raw_attr) == "1"
+          end
+          alias_method "#{attr}?", attr
+
+          alias_method "#{raw_attr}=", "#{attr}="
+          define_method "#{attr}=" do |value|
+            str_value = value ? "1" : "0"
+            public_send("#{raw_attr}=", str_value)
+          end
+        end
+      end
+    end
+
+    ATTRIBUTES = {
+      kernel_sysrq:            "kernel.sysrq",
+      forward_ipv4:            "net.ipv4.ip_forward",
+      # FIXME: alias for ipv6_forwarding_all
+      forward_ipv6:            "net.ipv6.conf.all.forwarding",
+      ipv4_forwarding_default: "net.ipv4.conf.default.forwarding",
+      ipv4_forwarding_all:     "net.ipv4.conf.all.forwarding",
+      ipv6_forwarding_default: "net.ipv6.conf.default.forwarding",
+      ipv6_forwarding_all:     "net.ipv6.conf.all.forwarding",
+      tcp_syncookies:          "net.ipv4.tcp_syncookies",
+      disable_ipv6:            "net.ipv6.conf.all.disable_ipv6"
+    }.freeze
+
+    attributes(ATTRIBUTES)
+
+    # Keys that are handled by this class
+    KNOWN_KEYS = ATTRIBUTES.values.uniq.freeze
+
+    boolean_attr :forward_ipv4, :forward_ipv6, :tcp_syncookies, :disable_ipv6,
+      :ipv4_forwarding_default, :ipv4_forwarding_all, :ipv6_forwarding_default,
+      :ipv6_forwarding_all
+
+    def initialize(file_handler: Yast::TargetFile)
+      super(PARSER, PATH, file_handler: file_handler)
+    end
+
+    # Loads sysctl content
+    #
+    # This method reads {PATH} and uses +/etc/sysctl.conf+ values as fallback.
+    def load
+      begin
+        super
+      rescue Errno::ENOENT # PATH does not exist yet
+        self.data = @parser.empty
+        @loaded = true
+      end
+
+      KNOWN_KEYS.each do |key|
+        next if data[key]
+
+        old_value = Yast::SCR.Read(SYSCTL_AGENT_PATH + key)
+        data[key] = old_value if old_value
+      end
+      nil
+    end
+
+    # Writes sysctl configuration
+    #
+    # Apart from writing the values to {PATH}, it cleans up the same entries in
+    # +/etc/sysctl.conf+ to avoid confusion.
+    def save
+      super
+      clean_old_values
+    end
+
+  private
+
+    # Path to the agent to handle the +/etc/sysctl.conf+ file
+    SYSCTL_AGENT_PATH = Yast::Path.new(".etc.sysctl_conf")
+
+    # Main sysctl configuration file
+    MAIN_SYSCTL_CONF_PATH = "/etc/sysctl.conf".freeze
+
+    # Cleans up present values from +/etc/sysctl.conf+ to reduce confusion
+    def clean_old_values
+      handler = BaseModel.default_file_handler
+      parser = AugeasParser.new("sysctl.lns")
+      parser.file_name = MAIN_SYSCTL_CONF_PATH
+      content = parser.parse(handler.read(MAIN_SYSCTL_CONF_PATH))
+      KNOWN_KEYS.each { |k| content.delete(k) }
+      handler.write(MAIN_SYSCTL_CONF_PATH, parser.serialize(content))
+    rescue Errno::ENOENT
+      log.info "File #{MAIN_SYSCTL_CONF_PATH} was not found"
+    end
+  end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-4.2.24/library/general/test/cfa/sysctl_test.rb 
new/yast2-4.2.27/library/general/test/cfa/sysctl_test.rb
--- old/yast2-4.2.24/library/general/test/cfa/sysctl_test.rb    1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-4.2.27/library/general/test/cfa/sysctl_test.rb    2019-10-09 
11:00:07.000000000 +0200
@@ -0,0 +1,229 @@
+#!/usr/bin/env rspec
+
+# 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"
+require "cfa/sysctl"
+
+describe CFA::Sysctl do
+  subject(:sysctl) { described_class.new(file_handler: file_handler) }
+
+  let(:yast_conf_path) { "sysctl-yast.conf" }
+  let(:file_handler) { File }
+
+  SYSCTL_CONF_VALUES = {
+    ".etc.sysctl_conf.\"net.ipv4.ip_forward\""          => "0",
+    ".etc.sysctl_conf.\"net.ipv6.conf.all.forwarding\"" => "0",
+    ".etc.sysctl_conf.\"kernel.sysrq\""                 => "0",
+    ".etc.sysctl_conf.\"net.ipv4.tcp_syncookies\""      => "1"
+  }.freeze
+
+  before do
+    allow(Yast::SCR).to receive(:Read) do |path|
+      SYSCTL_CONF_VALUES[path.to_s]
+    end
+    allow(Yast::TargetFile).to receive(:write).with("/etc/sysctl.conf", 
anything)
+    stub_const("CFA::Sysctl::PATH", File.join(GENERAL_DATA_PATH, 
yast_conf_path))
+    sysctl.load
+  end
+
+  describe "#raw_forward_ipv4" do
+    it "returns IPv4 forwarding raw value" do
+      expect(sysctl.raw_forward_ipv4).to eq("1")
+    end
+
+    context "when the value is not defined" do
+      let(:yast_conf_path) { "empty" }
+
+      it "returns the value from sysctl.conf" do
+        expect(sysctl.raw_forward_ipv4).to eq("0")
+      end
+    end
+  end
+
+  describe "#raw_forward_ipv6" do
+    it "returns IPv6 forwarding raw value" do
+      expect(sysctl.raw_forward_ipv6).to eq("1")
+    end
+
+    context "when the value is not defined" do
+      let(:yast_conf_path) { "empty" }
+
+      it "returns the value from sysctl.conf" do
+        expect(sysctl.raw_forward_ipv6).to eq("0")
+      end
+    end
+  end
+
+  describe "#forward_ipv4=" do
+    it "sets the forward_ipv4 value" do
+      expect { sysctl.forward_ipv4 = false }.to change { sysctl.forward_ipv4 
}.from(true).to(false)
+    end
+  end
+
+  describe "#forward_ipv6=" do
+    it "sets the forward_ipv6 value" do
+      expect { sysctl.forward_ipv6 = false }.to change { sysctl.forward_ipv6 
}.from(true).to(false)
+    end
+  end
+
+  describe "#kernel_sysrq" do
+    it "returns kernel.sysrq value" do
+      expect(sysctl.kernel_sysrq).to eq("1")
+    end
+
+    context "when the value is not defined" do
+      let(:yast_conf_path) { "empty" }
+
+      it "returns the value from sysctl.conf" do
+        expect(sysctl.kernel_sysrq).to eq("0")
+      end
+    end
+  end
+
+  describe "#kernel_sysrq=" do
+    it "sets the kernel.sysrq value" do
+      expect { sysctl.kernel_sysrq = "0" }.to change { sysctl.kernel_sysrq 
}.from("1").to("0")
+    end
+  end
+
+  describe "#save" do
+    before do
+      allow(Yast::SCR).to receive(:Write)
+      allow(Yast::TargetFile).to receive(:read).with("/etc/sysctl.conf")
+        .and_return("# Some comment\nkernel.sysrq=1")
+    end
+
+    it "writes changes to configuration file" do
+      expect(file_handler).to receive(:write)
+        .with(CFA::Sysctl::PATH, /.+ip_forward = 1.+forwarding = 1/m)
+      sysctl.save
+    end
+
+    it "removes the old values from /etc/sysctl.conf" do
+      expect(Yast::TargetFile).to receive(:write).with("/etc/sysctl.conf", "# 
Some comment\n")
+      sysctl.save
+    end
+
+    it "does not update missing values in /etc/sysctl.conf" do
+      expect(Yast::SCR).to_not receive(:Write)
+        
.with(Yast::Path.new(".etc.sysctl_conf.\"net.ipv4.conf.all.forwarding\""), 
anything)
+      sysctl.save
+    end
+
+    it "does not try to update unchanged values in /etc/sysctl.conf" do
+      expect(Yast::SCR).to_not receive(:Write)
+        .with(Yast::Path.new(".etc.sysctl_conf.\"net.ipv4.tcp_syncookies\""), 
anything)
+      sysctl.save
+    end
+
+    context "when /etc/sysctl.conf does not exist" do
+      before do
+        allow(Yast::TargetFile).to receive(:read).with("/etc/sysctl.conf")
+          .and_raise(Errno::ENOENT)
+      end
+
+      it "logs an error" do
+        expect(sysctl.log).to receive(:info).with(/not found/)
+        sysctl.save
+      end
+    end
+  end
+
+  describe "#forward_ipv4?" do
+    before { sysctl.forward_ipv4 = value }
+
+    context "when forwarding for IPv4 is enabled" do
+      let(:value) { true }
+
+      it "returns true" do
+        expect(sysctl.forward_ipv4?).to eq(true)
+      end
+    end
+
+    context "when forwarding for IPv4 is disabled" do
+      let(:value) { false }
+
+      it "returns false" do
+        expect(sysctl.forward_ipv4?).to eq(false)
+      end
+    end
+  end
+
+  describe "#forward_ipv6?" do
+    before { sysctl.forward_ipv6 = value }
+
+    context "when forwarding for IPv6 is enabled" do
+      let(:value) { true }
+
+      it "returns true" do
+        expect(sysctl.forward_ipv6?).to eq(true)
+      end
+    end
+
+    context "when forwarding for IPv6 is disabled" do
+      let(:value) { false }
+
+      it "returns false" do
+        expect(sysctl.forward_ipv6?).to eq(false)
+      end
+    end
+  end
+
+  describe "#tcp_syncookies?" do
+    before { sysctl.tcp_syncookies = value }
+
+    context "when TCP syncookies are enabled" do
+      let(:value) { true }
+
+      it "returns true" do
+        expect(sysctl.tcp_syncookies?).to eq(true)
+      end
+    end
+
+    context "when TCP syncookies are disabled" do
+      let(:value) { false }
+
+      it "returns false" do
+        expect(sysctl.tcp_syncookies?).to eq(false)
+      end
+    end
+  end
+
+  describe "#disable_ipv6?" do
+    before { sysctl.disable_ipv6 = value }
+
+    context "when IPv6 is disabled" do
+      let(:value) { true }
+
+      it "returns true" do
+        expect(sysctl.disable_ipv6?).to eq(true)
+      end
+    end
+
+    context "when IPv6 is not disabled" do
+      let(:value) { false }
+
+      it "returns false" do
+        expect(sysctl.disable_ipv6?).to eq(false)
+      end
+    end
+  end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-4.2.24/library/general/test/data/sysctl-yast.conf 
new/yast2-4.2.27/library/general/test/data/sysctl-yast.conf
--- old/yast2-4.2.24/library/general/test/data/sysctl-yast.conf 1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-4.2.27/library/general/test/data/sysctl-yast.conf 2019-10-09 
11:00:07.000000000 +0200
@@ -0,0 +1,8 @@
+kernel.sysrq = 1
+net.ipv4.conf.all.forwarding = 1
+net.ipv4.conf.default.forwarding = 1
+net.ipv4.ip_forward = 1
+net.ipv4.tcp_syncookies = 1
+net.ipv6.conf.all.disable_ipv6 = 1
+net.ipv6.conf.all.forwarding = 1
+net.ipv6.conf.default.forwarding = 1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-4.2.24/library/general/test/test_helper.rb 
new/yast2-4.2.27/library/general/test/test_helper.rb
--- old/yast2-4.2.24/library/general/test/test_helper.rb        2019-09-25 
13:10:54.000000000 +0200
+++ new/yast2-4.2.27/library/general/test/test_helper.rb        2019-10-09 
11:00:07.000000000 +0200
@@ -1 +1,3 @@
 require_relative "../../../test/test_helper.rb"
+
+GENERAL_DATA_PATH = File.join(__dir__, "data")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-4.2.24/library/packages/src/lib/y2packager/package.rb 
new/yast2-4.2.27/library/packages/src/lib/y2packager/package.rb
--- old/yast2-4.2.24/library/packages/src/lib/y2packager/package.rb     
2019-09-25 13:10:54.000000000 +0200
+++ new/yast2-4.2.27/library/packages/src/lib/y2packager/package.rb     
2019-10-09 11:00:07.000000000 +0200
@@ -39,10 +39,12 @@
       # @return [Array<Package>,nil] Packages named like `name`. It returns 
`nil`
       #   if some problem occurs interacting with libzypp.
       def find(name)
-        props = Yast::Pkg.ResolvableProperties(name, :package, "")
-        return nil if props.nil?
+        resolvables = Yast::Pkg.Resolvables({ kind: :package, name: name },
+          [:name, :source, :version])
 
-        props.map { |i| new(i["name"], i["source"], i["version"]) }
+        return nil if resolvables.nil?
+
+        resolvables.map { |i| new(i["name"], i["source"], i["version"]) }
       end
 
       # Find the highest version of requested package with given statuses
@@ -78,9 +80,21 @@
     # Ask libzypp about package status.
     #
     # @return [Symbol] Package status (:installed, :available, etc.)
-    # @see Yast::Pkg.PkgProperties
+    # @see Yast::Pkg.Resolvables
     def status
-      Yast::Pkg.PkgProperties(name)["status"]
+      resolvables = Yast::Pkg.Resolvables({ kind: :package, name: name,
+        version: version, source: repo_id }, [:status])
+
+      log.warn "Found multiple resolvables: #{resolvables}" if 
resolvables.size > 1
+
+      resolvable = resolvables.first
+
+      if !resolvable
+        log.warn "Resolvable not found: #{name}-#{version} from repo 
#{repo_id}"
+        return nil
+      end
+
+      resolvable["status"]
     end
 
     # Download a package to the given path
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-4.2.24/library/packages/test/y2packager/package_test.rb 
new/yast2-4.2.27/library/packages/test/y2packager/package_test.rb
--- old/yast2-4.2.24/library/packages/test/y2packager/package_test.rb   
2019-09-25 13:10:54.000000000 +0200
+++ new/yast2-4.2.27/library/packages/test/y2packager/package_test.rb   
2019-10-09 11:00:07.000000000 +0200
@@ -14,7 +14,8 @@
     let(:package) { instance_double(Y2Packager::Package) }
 
     it "returns packages with a given name" do
-      expect(Yast::Pkg).to receive(:ResolvableProperties).with(name, :package, 
"")
+      expect(Yast::Pkg).to receive(:Resolvables)
+        .with({ kind: :package, name: "yast2" }, [:name, :source, :version])
         .and_return([{ "name" => "yast2", "source" => 1, "version" => "12.3" 
}])
       expect(Y2Packager::Package).to receive(:new).with(name, 1, "12.3")
         .and_return(package)
@@ -24,15 +25,23 @@
 
   describe ".last_version" do
     let(:name) { "yast2" }
-    let(:unknown_status) { { "status" => :unknown } }
-    let(:available_status) { { "status" => :available } }
-    let(:selected_status) { { "status" => :selected } }
+    let(:unknown_status) { [{ "status" => :unknown }] }
+    let(:available_status) { [{ "status" => :available }] }
+    let(:selected_status) { [{ "status" => :selected }] }
 
     before do
-      allow(Yast::Pkg).to receive(:PkgProperties).with(name)
-        .and_return(unknown_status, available_status, selected_status)
+      allow(Yast::Pkg).to receive(:Resolvables)
+        .with({ kind: :package, name: "yast2", version: "15.0", source: 0 }, 
[:status])
+        .and_return(unknown_status)
+      allow(Yast::Pkg).to receive(:Resolvables)
+        .with({ kind: :package, name: "yast2", version: "12.3", source: 1 }, 
[:status])
+        .and_return(selected_status)
+      allow(Yast::Pkg).to receive(:Resolvables)
+        .with({ kind: :package, name: "yast2", version: "12.0", source: 2 }, 
[:status])
+        .and_return(available_status)
 
-      allow(Yast::Pkg).to receive(:ResolvableProperties).with(name, :package, 
"")
+      allow(Yast::Pkg).to receive(:Resolvables)
+        .with({ kind: :package, name: "yast2" }, [:name, :source, :version])
         .and_return(
           [
             { "name" => "yast2", "source" => 0, "version" => "15.0" },
@@ -104,8 +113,9 @@
 
   describe "#status" do
     it "returns package status" do
-      expect(Yast::Pkg).to receive(:PkgProperties)
-        .with(package.name).and_return("status" => :available)
+      expect(Yast::Pkg).to receive(:Resolvables)
+        .with({ kind: :package, name: "release-notes-dummy", version: "15.0", 
source: 1 }, [:status])
+        .and_return(["status" => :available])
       expect(package.status).to eq(:available)
     end
   end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-4.2.24/package/yast2.changes 
new/yast2-4.2.27/package/yast2.changes
--- old/yast2-4.2.24/package/yast2.changes      2019-09-25 13:10:54.000000000 
+0200
+++ new/yast2-4.2.27/package/yast2.changes      2019-10-09 11:00:07.000000000 
+0200
@@ -1,4 +1,23 @@
 -------------------------------------------------------------------
+Wed Oct  9 08:02:32 UTC 2019 - Ladislav Slezák <[email protected]>
+
+- Fixed evaluating the available package versions, fixed crash
+  when trying to download a non-existing package (bsc#1151824)
+- 4.2.27
+
+-------------------------------------------------------------------
+Mon Oct  7 16:00:09 UTC 2019 - Imobach Gonzalez Sosa <[email protected]>
+
+- Remove old values from /etc/sysctl.conf (jsc#SLE-9077).
+- 4.2.26
+
+-------------------------------------------------------------------
+Thu Oct  3 12:31:35 UTC 2019 - Imobach Gonzalez Sosa <[email protected]>
+
+- Add a CFA based class to adjust sysctl settings (jsc#SLE-9077).
+- 4.2.25
+
+-------------------------------------------------------------------
 Wed Sep 25 09:40:09 UTC 2019 - Imobach Gonzalez Sosa <[email protected]>
 
 - Fix module name inference when reading .desktop files
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-4.2.24/package/yast2.spec 
new/yast2-4.2.27/package/yast2.spec
--- old/yast2-4.2.24/package/yast2.spec 2019-09-25 13:10:54.000000000 +0200
+++ new/yast2-4.2.27/package/yast2.spec 2019-10-09 11:00:07.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2
-Version:        4.2.24
+Version:        4.2.27
 Release:        0
 Summary:        YaST2 Main Package
 License:        GPL-2.0-only
@@ -38,6 +38,8 @@
 BuildRequires:  rubygem(%{rb_default_ruby_abi}:abstract_method)
 # for file access using augeas
 BuildRequires:  rubygem(%{rb_default_ruby_abi}:cfa)
+# for used augeas lenses
+BuildRequires:  augeas-lenses
 # for running scripts
 BuildRequires:  update-desktop-files
 BuildRequires:  rubygem(%{rb_default_ruby_abi}:cheetah)
@@ -72,6 +74,8 @@
 Requires:       rubygem(%{rb_default_ruby_abi}:abstract_method)
 # for file access using augeas
 Requires:       rubygem(%{rb_default_ruby_abi}:cfa)
+# for used augeas lenses
+Requires:       augeas-lenses
 # For converting to/from punycode strings
 Requires:       sysconfig >= 0.80.0
 Requires:       rubygem(%{rb_default_ruby_abi}:simpleidn)


Reply via email to