Hello community,

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

Package is "yast2-squid"

Fri Feb  2 22:21:46 2018 rev:46 rq:571818 version:4.0.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-squid/yast2-squid.changes  2017-10-17 
01:52:03.795712646 +0200
+++ /work/SRC/openSUSE:Factory/.yast2-squid.new/yast2-squid.changes     
2018-02-02 22:21:47.411253760 +0100
@@ -1,0 +2,6 @@
+Mon Jan 29 16:11:50 UTC 2018 - knut.anders...@suse.com
+
+- Replace SuSEFirewall2 by firewalld (fate#323460)
+- 4.0.1
+
+-------------------------------------------------------------------

Old:
----
  yast2-squid-4.0.0.tar.bz2

New:
----
  yast2-squid-4.0.1.tar.bz2

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

Other differences:
------------------
++++++ yast2-squid.spec ++++++
--- /var/tmp/diff_new_pack.QxfrCR/_old  2018-02-02 22:21:48.203216788 +0100
+++ /var/tmp/diff_new_pack.QxfrCR/_new  2018-02-02 22:21:48.207216601 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package yast2-squid
 #
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,13 +17,14 @@
 
 
 Name:           yast2-squid
-Version:        4.0.0
+Version:        4.0.1
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 Source0:        %{name}-%{version}.tar.bz2
 
-Requires:       yast2 >= 2.21.22
+# SuSEFirewall2 replaced by firewalld (fate#323460)
+Requires:       yast2 >= 4.0.39
 
 %if 0%{?suse_version} > 1325
 BuildRequires:  libboost_regex-devel
@@ -35,7 +36,8 @@
 BuildRequires:  libtool
 BuildRequires:  perl-XML-Writer
 BuildRequires:  update-desktop-files
-BuildRequires:  yast2
+# SuSEFirewall2 replaced by firewalld (fate#323460)
+BuildRequires:  yast2 >= 4.0.39
 BuildRequires:  yast2-core-devel
 BuildRequires:  yast2-devtools >= 3.1.10
 BuildRequires:  yast2-testsuite

++++++ yast2-squid-4.0.0.tar.bz2 -> yast2-squid-4.0.1.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-squid-4.0.0/Dockerfile 
new/yast2-squid-4.0.1/Dockerfile
--- old/yast2-squid-4.0.0/Dockerfile    2017-02-01 10:38:22.081942258 +0100
+++ new/yast2-squid-4.0.1/Dockerfile    2018-02-01 21:36:57.000000000 +0100
@@ -1,6 +1,6 @@
 FROM yastdevel/ruby
 RUN zypper --gpg-auto-import-keys --non-interactive in --no-recommends \
-  boost-devel \
+  libboost_regex-devel \
   gcc-c++ \
   libtool \
   yast2-core-devel
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-squid-4.0.0/package/yast2-squid.changes 
new/yast2-squid-4.0.1/package/yast2-squid.changes
--- old/yast2-squid-4.0.0/package/yast2-squid.changes   2017-10-13 
15:01:31.206995386 +0200
+++ new/yast2-squid-4.0.1/package/yast2-squid.changes   2018-02-01 
21:36:57.000000000 +0100
@@ -1,4 +1,10 @@
 -------------------------------------------------------------------
+Mon Jan 29 16:11:50 UTC 2018 - knut.anders...@suse.com
+
+- Replace SuSEFirewall2 by firewalld (fate#323460)
+- 4.0.1
+
+-------------------------------------------------------------------
 Fri Oct 13 10:35:05 UTC 2017 - lsle...@suse.cz
 
 - Replace the generic "boost-devel" build dependency with more
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-squid-4.0.0/package/yast2-squid.spec 
new/yast2-squid-4.0.1/package/yast2-squid.spec
--- old/yast2-squid-4.0.0/package/yast2-squid.spec      2017-10-13 
15:01:31.206995386 +0200
+++ new/yast2-squid-4.0.1/package/yast2-squid.spec      2018-02-01 
21:36:57.000000000 +0100
@@ -17,13 +17,14 @@
 
 
 Name:           yast2-squid
-Version:        4.0.0
+Version:        4.0.1
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 Source0:        %{name}-%{version}.tar.bz2
 
-Requires:       yast2 >= 2.21.22
+# SuSEFirewall2 replaced by firewalld (fate#323460)
+Requires:       yast2 >= 4.0.39
 
 %if 0%{?suse_version} > 1325
 BuildRequires:  libboost_regex-devel
@@ -35,7 +36,8 @@
 BuildRequires:  libtool
 BuildRequires:  perl-XML-Writer
 BuildRequires:  update-desktop-files
-BuildRequires:  yast2
+# SuSEFirewall2 replaced by firewalld (fate#323460)
+BuildRequires:  yast2 >= 4.0.39
 BuildRequires:  yast2-core-devel
 BuildRequires:  yast2-devtools >= 3.1.10
 BuildRequires:  yast2-testsuite
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-squid-4.0.0/src/modules/Squid.rb 
new/yast2-squid-4.0.1/src/modules/Squid.rb
--- old/yast2-squid-4.0.0/src/modules/Squid.rb  2015-07-08 10:06:33.024665349 
+0200
+++ new/yast2-squid-4.0.1/src/modules/Squid.rb  2018-02-01 21:36:57.000000000 
+0100
@@ -29,6 +29,7 @@
 # Representation of the configuration of squid.
 # Input and output routines.
 require "yast"
+require "y2firewall/firewalld"
 
 module Yast
   class SquidClass < Module
@@ -41,16 +42,12 @@
       Yast.import "Message"
       Yast.import "Service"
       Yast.import "FileUtils"
-      Yast.import "SuSEFirewall"
 
       # Defines path used in SCR::Read/Write functions
       @squid_path = path(".etc.squid")
 
-      # Defines location of sysconfig file
-      @sysconfig_file = "/etc/sysconfig/SuSEfirewall2.d/services/squid"
-
       # Defines name of service which is used by firewall when it's openning 
ports.
-      @firewall_service_name = "service:squid"
+      @firewall_service_name = "squid"
 
 
       # Data was modified?
@@ -135,9 +132,6 @@
       # Don't run services and SuSEconfig, it's all done at one place.
       @write_only = false
 
-
-
-
       # Abort function
       # return boolean return true if abort
       #global boolean() AbortFunction = GetModified;
@@ -699,7 +693,7 @@
     # Returns only list of configured ports (no hosts and so on)
     def GetHttpPortsOnly
       ret = []
-      Builtins.foreach(@http_ports) do |value|
+      @http_ports.each do |value|
         if Ops.greater_than(Builtins.size(Ops.get_string(value, "port", "")), 
0)
           ret = Builtins.add(ret, Ops.get_string(value, "port", ""))
         end
@@ -1124,7 +1118,7 @@
       Progress.NextStage
 
       Progress.set(false)
-      if !SuSEFirewall.Read
+      if !firewalld.read
         # bnc#808722: yast2 squid fail if SuSEfirewall in not installed
         # other or no firewall can be installed
         Builtins.y2warning("Cannot read firewall settings.")
@@ -1342,65 +1336,26 @@
     end
 
     def writeFirewallSettings
-      ok = true
-
       if !GetModified()
         Builtins.y2debug(
           "Squid::writeFirewallSettings - no setting to write, because 
nothing's changed"
         )
-        return ok
+        return true
       end
 
-      if !SCR.RegisterAgent(
-          path(".firewall_service_definition"),
-          term(:ag_ini, term(:SysConfigFile, @sysconfig_file))
-        )
-        ok = false
-        Builtins.y2error(
-          "Unable to register sysconfig agent for %1",
-          @sysconfig_file
-        )
-      end
-      if !SCR.Write(
-          path(".firewall_service_definition.TCP"),
-          Builtins.mergestring(GetHttpPortsOnly(), " ")
-        ) ||
-          !SCR.Write(path(".firewall_service_definition"), nil)
-        ok = false
-        Builtins.y2error(
-          "Unable to write settings into sysconfig file %1",
-          @sysconfig_file
-        )
-      end
-      if !SCR.UnregisterAgent(path(".firewall_service_definition"))
-        ok = false
-        Builtins.y2error(
-          "Unable to unregister sysconfig agent for %1",
-          @sysconfig_file
-        )
-      end
-      # write /etc/sysconfig/SuSEFirewall2.d/services/squid file:
-      # string service_squid_file =
-      #     "## Name: Squid Service\n" +
-      #     "## Description: Opens ports for Squid\n" +
-      #     "TCP=\"" + mergestring(GetHttpPortsOnly(), " ") +"\"\n";
-      # if (!SCR::Write(.target.string, 
"/etc/sysconfig/SuSEfirewall2.d/services/squid", service_squid_file)){
-      #     y2error("Squid::writeFirewallSettings - failed to write into 
/etc/sysconfig/SuSEfirewall2.d/services/squid file.");
-      #     ok = false;
-      # }
+      tcp_ports = GetHttpPortsOnly()
 
-      # write firewall settings
-      SuSEFirewall.SetModified
-      Progress.set(false)
-      if !SuSEFirewall.Write
-        Builtins.y2error(
-          "Squid::writeFirewallSettings - SuSEFirewall::Write failed"
+      begin
+        Y2Firewall::Firewalld::Service.modify_ports(
+          name: @firewall_service_name,
+          tcp_ports: GetHttpPortsOnly()
         )
-        ok = false
+      rescue Y2Firewall::Firewalld::Service::NotFound
+        Builtins.y2error("Firewalld '#{@firewall_service_name}' service is not 
available.")
+        return false
       end
-      Progress.set(true)
 
-      ok
+      firewalld.write
     end
 
     # Returns true if Squid service is running.
@@ -1728,6 +1683,12 @@
     publish :function => :Export, :type => "map ()"
     publish :function => :Summary, :type => "list ()"
     publish :function => :AutoPackages, :type => "map ()"
+
+    private
+
+      def firewalld
+        Y2Firewall::Firewalld.instance
+      end
   end
 
   Squid = SquidClass.new


Reply via email to