Hello community,

here is the log from the commit of package yast2 for openSUSE:Factory checked 
in at 2018-02-16 21:41:45
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2 (Old)
 and      /work/SRC/openSUSE:Factory/.yast2.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2"

Fri Feb 16 21:41:45 2018 rev:418 rq:577190 version:4.0.53

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2/yast2.changes      2018-02-12 
10:07:03.443144376 +0100
+++ /work/SRC/openSUSE:Factory/.yast2.new/yast2.changes 2018-02-16 
21:41:45.013410737 +0100
@@ -1,0 +2,20 @@
+Thu Feb 15 17:34:40 UTC 2018 - lsle...@suse.cz
+
+- Fixed list of the URL schemes without host, fixes processing
+  URLs with the "hd:/" scheme (bsc#1077310)
+- 4.0.53
+
+-------------------------------------------------------------------
+Wed Feb 14 12:48:54 UTC 2018 - igonzalezs...@suse.com
+
+- Add a method to get the list of available license translations
+  for a given product (related to FATE#322276).
+- 4.0.52
+
+-------------------------------------------------------------------
+Mon Feb 12 09:23:34 UTC 2018 - knut.anders...@suse.com
+
+- Firewalld: Added interfaces helpers (fate#323460)
+- 4.0.51
+
+-------------------------------------------------------------------

Old:
----
  yast2-4.0.50.tar.bz2

New:
----
  yast2-4.0.53.tar.bz2

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

Other differences:
------------------
++++++ yast2.spec ++++++
--- /var/tmp/diff_new_pack.dB1otx/_old  2018-02-16 21:41:45.693386215 +0100
+++ /var/tmp/diff_new_pack.dB1otx/_new  2018-02-16 21:41:45.697386071 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           yast2
-Version:        4.0.50
+Version:        4.0.53
 Release:        0
 Summary:        YaST2 - Main Package
 License:        GPL-2.0

++++++ yast2-4.0.50.tar.bz2 -> yast2-4.0.53.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-4.0.50/library/network/src/Makefile.am 
new/yast2-4.0.53/library/network/src/Makefile.am
--- old/yast2-4.0.50/library/network/src/Makefile.am    2018-02-09 
11:48:29.000000000 +0100
+++ new/yast2-4.0.53/library/network/src/Makefile.am    2018-02-16 
10:06:50.000000000 +0100
@@ -52,6 +52,12 @@
   lib/y2firewall/firewalld/api/services.rb \
   lib/y2firewall/firewalld/api/zones.rb
 
-EXTRA_DIST = $(module_DATA) $(scrconf_DATA) $(agent_SCRIPTS) $(ylib_DATA) 
$(yfwlib_DATA) $(yfwdlib_DATA) $(yfwdapilib_DATA)
+yfwhelperslibdir = @ylibdir@/y2firewall/helpers
+yfwhelperslib_DATA = \
+  lib/y2firewall/helpers/interfaces.rb
+
+EXTRA_DIST = \
+  $(module_DATA) $(scrconf_DATA) $(agent_SCRIPTS) $(ylib_DATA) \
+  $(yfwlib_DATA) $(yfwdlib_DATA) $(yfwdapilib_DATA) $(yfwhelperslib_DATA)
 
 include $(top_srcdir)/Makefile.am.common
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-4.0.50/library/network/src/lib/y2firewall/helpers/interfaces.rb 
new/yast2-4.0.53/library/network/src/lib/y2firewall/helpers/interfaces.rb
--- old/yast2-4.0.50/library/network/src/lib/y2firewall/helpers/interfaces.rb   
1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-4.0.53/library/network/src/lib/y2firewall/helpers/interfaces.rb   
2018-02-16 10:06:50.000000000 +0100
@@ -0,0 +1,96 @@
+# encoding: utf-8
+#
+# ***************************************************************************
+#
+# Copyright (c) 2018 SUSE LLC.
+# All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of version 2 or 3 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 about this file by physical or electronic mail,
+# you may find current contact information at www.suse.com
+#
+# ***************************************************************************
+require "yast"
+require "y2firewall/firewalld"
+
+module Y2Firewall
+  module Helpers
+    # Set of helpers methods for operating with NetworkInterfaces and firewalld
+    # zones.
+    module Interfaces
+      def self.included(_base)
+        Yast.import "NetworkInterfaces"
+      end
+
+      # Return an instance of Y2Firewall::Firewalld
+      #
+      # @return [Y2Firewall::Firewalld] a firewalld instance
+      def firewalld
+        Y2Firewall::Firewalld.instance
+      end
+
+      # Return the name of interfaces which belongs to the default zone
+      #
+      # @return [Array<String>] default zone interface names
+      def default_interfaces
+        known_interfaces.select { |i| i["zone"].to_s.empty? }.map { |i| 
i["id"] }
+      end
+
+      # Return the zone name for a given interface from the firewalld instance
+      # instead of from the API.
+      #
+      # @param name [String] interface name
+      # @return [String, nil] zone name whether belongs to some or nil if not
+      def interface_zone(name)
+        zone = firewalld.zones.find { |z| z.interfaces.include?(name) }
+
+        zone ? zone.name : nil
+      end
+
+      # Convenience method to return the default zone object
+      #
+      # @return [Y2Firewall::Firewalld::Zone] default zone
+      def default_zone
+        @default_zone ||= firewalld.find_zone(firewalld.default_zone)
+      end
+
+      # Return a hash of all the known interfaces with their "id", "name" and
+      # "zone".
+      #
+      # @example
+      #   CWMFirewallInterfaces.known_interfaces #=>
+      #     [
+      #       { "id" => "eth0", "name" => "Intel Ethernet Connection I217-LM", 
"zone" => "external"},
+      #       { "id" => "eth1", "name" => "Intel Ethernet Connection I217-LM", 
"zone" => "public"},
+      #       { "id" => "eth2", "name" => "Intel Ethernet Connection I217-LM", 
"zone" => nil},
+      #       { "id" => "eth3", "name" => "Intel Ethernet Connection I217-LM", 
"zone" => nil},
+      #     ]
+      #
+      # @return [Array<Hash<String,String>>] known interfaces "id", "name" and 
"zone"
+      def known_interfaces
+        return @known_interfaces if @known_interfaces
+
+        interfaces = Yast::NetworkInterfaces.List("").reject { |i| i == "lo" }
+
+        @known_interfaces = interfaces.map do |interface|
+          {
+            "id"   => interface,
+            "name" => Yast::NetworkInterfaces.GetValue(interface, "NAME"),
+            "zone" => interface_zone(interface)
+          }
+        end
+      end
+    end
+  end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-4.0.50/library/network/src/modules/CWMFirewallInterfaces.rb 
new/yast2-4.0.53/library/network/src/modules/CWMFirewallInterfaces.rb
--- old/yast2-4.0.50/library/network/src/modules/CWMFirewallInterfaces.rb       
2018-02-09 11:48:29.000000000 +0100
+++ new/yast2-4.0.53/library/network/src/modules/CWMFirewallInterfaces.rb       
2018-02-16 10:06:50.000000000 +0100
@@ -40,6 +40,7 @@
 
 require "yast"
 require "y2firewall/firewalld"
+require "y2firewall/helpers/interfaces"
 
 module Yast
   # This class provide a set of methods to define a widget for handling with
@@ -66,6 +67,7 @@
   #
   #   Y2Firewall::Firewalld.instance.write
   class CWMFirewallInterfacesClass < Module
+    include Y2Firewall::Helpers::Interfaces
     include Yast::Logger
 
     # [Array<String>] List of all interfaces relevant for firewall settings
@@ -999,58 +1001,6 @@
       end
     end
 
-    # Convenience method to return the default zone object
-    #
-    # @return [Y2Firewall::Firewalld::Zone] default zone
-    def default_zone
-      @default_zone ||= firewalld.find_zone(firewalld.default_zone)
-    end
-
-    # Return a hash of all the known interfaces with their "id", "name" and
-    # "zone".
-    #
-    # @example
-    #   CWMFirewallInterfaces.known_interfaces #=>
-    #     [
-    #       { "id" => "eth0", "name" => "Intel Ethernet Connection I217-LM", 
"zone" => "external"},
-    #       { "id" => "eth1", "name" => "Intel Ethernet Connection I217-LM", 
"zone" => "public"},
-    #       { "id" => "eth2", "name" => "Intel Ethernet Connection I217-LM", 
"zone" => nil},
-    #       { "id" => "eth3", "name" => "Intel Ethernet Connection I217-LM", 
"zone" => nil},
-    #     ]
-    #
-    # @return [Array<Hash<String,String>>] known interfaces "id", "name" and 
"zone"
-    def known_interfaces
-      return @known_interfaces if @known_interfaces
-
-      interfaces = NetworkInterfaces.List("").reject { |i| i == "lo" }
-
-      @known_interfaces = interfaces.map do |interface|
-        {
-          "id"   => interface,
-          "name" => NetworkInterfaces.GetValue(interface, "NAME"),
-          "zone" => interface_zone(interface)
-        }
-      end
-    end
-
-    # Return the name of interfaces which belongs to the default zone
-    #
-    # @return [Array<String>] default zone interface names
-    def default_interfaces
-      known_interfaces.select { |i| i["zone"].to_s.empty? }.map { |i| i["id"] }
-    end
-
-    # Return the zone name for a given interface from the firewalld instance
-    # instead of from the API.
-    #
-    # @param name [String] interface name
-    # @return [String, nil] zone name whether belongs to some or nil if not
-    def interface_zone(name)
-      zone = firewalld.zones.find { |z| z.interfaces.include?(name) }
-
-      zone ? zone.name : nil
-    end
-
     def zone_services(services)
       services_status = {}
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-4.0.50/library/network/test/y2firewall/helpers/interfaces_test.rb 
new/yast2-4.0.53/library/network/test/y2firewall/helpers/interfaces_test.rb
--- old/yast2-4.0.50/library/network/test/y2firewall/helpers/interfaces_test.rb 
1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-4.0.53/library/network/test/y2firewall/helpers/interfaces_test.rb 
2018-02-16 10:06:50.000000000 +0100
@@ -0,0 +1,60 @@
+#!/usr/bin/env rspec
+
+require_relative "../../test_helper"
+require "y2firewall/helpers/interfaces"
+
+class DummyClass
+  include Y2Firewall::Helpers::Interfaces
+end
+
+describe Y2Firewall::Helpers::Interfaces do
+  subject { DummyClass.new }
+  let(:external) { Y2Firewall::Firewalld::Zone.new(name: "external") }
+  let(:dmz) { Y2Firewall::Firewalld::Zone.new(name: "dmz") }
+  let(:firewalld) { Y2Firewall::Firewalld.instance }
+
+  before do
+    allow(Yast::NetworkInterfaces).to receive("List").and_return(["eth0", 
"eth1"])
+    allow(Yast::NetworkInterfaces).to receive("GetValue").with("eth0", 
"NAME").and_return("Intel I217-LM")
+    allow(Yast::NetworkInterfaces).to receive("GetValue").with("eth1", 
"NAME").and_return("Intel I217-LM")
+    allow(subject).to receive(:firewalld).and_return(firewalld)
+    external.interfaces = ["eth0"]
+    dmz.interfaces = []
+    firewalld.zones = [dmz, external]
+    firewalld.default_zone = "external"
+  end
+
+  describe "#interface_zone" do
+    it "returns the zone name of the given interface" do
+      expect(subject.interface_zone("eth0")).to eql("external")
+    end
+
+    it "returns nil if the interface does not belong to any zone" do
+      expect(subject.interface_zone("eth1")).to eql(nil)
+    end
+  end
+
+  describe "#known_interfaces" do
+    it "returns a hash with the 'id', 'name' and zone of the current 
interfaces" do
+      expect(subject.known_interfaces)
+        .to eql(
+          [
+            { "id" => "eth0", "name" => "Intel I217-LM", "zone" => "external" 
},
+            { "id" => "eth1", "name" => "Intel I217-LM", "zone" => nil }
+          ]
+        )
+    end
+  end
+
+  describe "#default_interfaces" do
+    it "returns all the interface names that does not belong explicitly to any 
zone" do
+      expect(subject.default_interfaces).to eql(["eth1"])
+    end
+  end
+
+  describe "#default_zone" do
+    it "returns the Y2Firewall::Firewalld::Zone marked as default in firewalld 
" do
+      expect(subject.default_zone).to eql(external)
+    end
+  end
+end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-4.0.50/library/packages/src/lib/y2packager/product.rb 
new/yast2-4.0.53/library/packages/src/lib/y2packager/product.rb
--- old/yast2-4.0.50/library/packages/src/lib/y2packager/product.rb     
2018-02-09 11:48:29.000000000 +0100
+++ new/yast2-4.0.53/library/packages/src/lib/y2packager/product.rb     
2018-02-16 10:06:50.000000000 +0100
@@ -214,6 +214,24 @@
       Yast::Pkg.PrdHasLicenseConfirmed(name)
     end
 
+    # [String] Default license language.
+    DEFAULT_LICENSE_LANG = "en_US".freeze
+
+    # Return available locales for product's license
+    #
+    # @return [Array<String>] Language codes ("de_DE", "en_US", etc.)
+    def license_locales
+      locales = Yast::Pkg.PrdLicenseLocales(name)
+      if locales.nil?
+        log.error "Error getting the list of available license translations 
for '#{name}'"
+        return []
+      end
+
+      empty_idx = locales.index("")
+      locales[empty_idx] = DEFAULT_LICENSE_LANG if empty_idx
+      locales
+    end
+
     # Return product's release notes
     #
     # @param format    [Symbol] Release notes format (use :txt as default)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-4.0.50/library/packages/test/y2packager/product_test.rb 
new/yast2-4.0.53/library/packages/test/y2packager/product_test.rb
--- old/yast2-4.0.50/library/packages/test/y2packager/product_test.rb   
2018-02-09 11:48:29.000000000 +0100
+++ new/yast2-4.0.53/library/packages/test/y2packager/product_test.rb   
2018-02-16 10:06:50.000000000 +0100
@@ -252,6 +252,35 @@
     end
   end
 
+  describe "#license_locales" do
+    it "returns license locales from libzypp" do
+      expect(Yast::Pkg).to receive(:PrdLicenseLocales).with(product.name)
+        .and_return(["en_US", "de_DE"])
+      expect(product.license_locales).to eq(["en_US", "de_DE"])
+    end
+
+    context "when the empty locale is reported by libzypp" do
+      before do
+        allow(Yast::Pkg).to receive(:PrdLicenseLocales).with(product.name)
+          .and_return([""])
+      end
+
+      it "converts it to the default one (en_US)" do
+        expect(product.license_locales).to eq(["en_US"])
+      end
+    end
+
+    context "when the product is not found" do
+      before do
+        allow(Yast::Pkg).to receive(:PrdLicenseLocales).and_return(nil)
+      end
+
+      it "returns an empty array" do
+        expect(product.license_locales).to eq([])
+      end
+    end
+  end
+
   describe "#license_confirmation_required?" do
     before do
       allow(Yast::Pkg).to 
receive(:PrdNeedToAcceptLicense).with(product.name).and_return(needed)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-4.0.50/library/types/src/modules/URL.rb 
new/yast2-4.0.53/library/types/src/modules/URL.rb
--- old/yast2-4.0.50/library/types/src/modules/URL.rb   2018-02-09 
11:48:29.000000000 +0100
+++ new/yast2-4.0.53/library/types/src/modules/URL.rb   2018-02-16 
10:06:50.000000000 +0100
@@ -655,9 +655,10 @@
 
   private
 
-    # Schemes which should not include a host.
+    # Schemes which should not include a host.Should be kept in sync with 
libzypp.
+    # @see 
https://github.com/openSUSE/libzypp/blob/d9c97b883ac1561225c4d728a5f6c8a34498d5b9/zypp/Url.cc#L184-L190
     # @see #merge_host_and_path
-    SCHEMES_WO_HOST = ["cd", "dvd"].freeze
+    SCHEMES_WO_HOST = ["cd", "dvd", "hd", "iso", "dir"].freeze
 
     # Merges host and path tokens
     #
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-4.0.50/library/types/test/url_test.rb 
new/yast2-4.0.53/library/types/test/url_test.rb
--- old/yast2-4.0.50/library/types/test/url_test.rb     2018-02-09 
11:48:29.000000000 +0100
+++ new/yast2-4.0.53/library/types/test/url_test.rb     2018-02-16 
10:06:50.000000000 +0100
@@ -288,7 +288,12 @@
       "http://user:password@[2001:de8:0:f123::1]:8080/path/to/dir";             
                  => 
"http://user:password@[2001:de8:0:f123::1]:8080/path/to/dir";,
       "http://name:p...@www.suse.cz:80/path/index.html?question#part";          
                  => 
"http://name:p...@www.suse.cz:80/path/index.html?question#part";,
       
"smb://username:passwd@servername/share/path/on/the/share?mountoptions=ro&workgroup=group"
 => 
"smb://username:passwd@servername/share/path/on/the/share?mountoptions=ro&workgroup=group",
-      "slp:/"                                                                  
                  => "slp://"
+      "slp:/"                                                                  
                  => "slp://",
+      "dir:/"                                                                  
                  => "dir:///",
+      "iso:/"                                                                  
                  => "iso:///",
+      "hd:/"                                                                   
                  => "hd:///",
+      "cd:/"                                                                   
                  => "cd:///",
+      "dvd:/"                                                                  
                  => "dvd:///"
     }.freeze
 
     URLS.each do |url, rebuilt|
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-4.0.50/package/yast2.changes 
new/yast2-4.0.53/package/yast2.changes
--- old/yast2-4.0.50/package/yast2.changes      2018-02-09 11:48:29.000000000 
+0100
+++ new/yast2-4.0.53/package/yast2.changes      2018-02-16 10:06:50.000000000 
+0100
@@ -1,4 +1,24 @@
 -------------------------------------------------------------------
+Thu Feb 15 17:34:40 UTC 2018 - lsle...@suse.cz
+
+- Fixed list of the URL schemes without host, fixes processing
+  URLs with the "hd:/" scheme (bsc#1077310)
+- 4.0.53
+
+-------------------------------------------------------------------
+Wed Feb 14 12:48:54 UTC 2018 - igonzalezs...@suse.com
+
+- Add a method to get the list of available license translations
+  for a given product (related to FATE#322276).
+- 4.0.52
+
+-------------------------------------------------------------------
+Mon Feb 12 09:23:34 UTC 2018 - knut.anders...@suse.com
+
+- Firewalld: Added interfaces helpers (fate#323460)
+- 4.0.51
+
+-------------------------------------------------------------------
 Thu Feb  8 12:10:29 UTC 2018 - knut.anders...@suse.com
 
 - Drop (x)inetd agents
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-4.0.50/package/yast2.spec 
new/yast2-4.0.53/package/yast2.spec
--- old/yast2-4.0.50/package/yast2.spec 2018-02-09 11:48:29.000000000 +0100
+++ new/yast2-4.0.53/package/yast2.spec 2018-02-16 10:06:50.000000000 +0100
@@ -16,7 +16,7 @@
 #
 
 Name:           yast2
-Version:        4.0.50
+Version:        4.0.53
 Release:        0
 Summary:        YaST2 - Main Package
 License:        GPL-2.0


Reply via email to