Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package subversion for openSUSE:Factory 
checked in at 2024-10-25 19:19:00
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/subversion (Old)
 and      /work/SRC/openSUSE:Factory/.subversion.new.2020 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "subversion"

Fri Oct 25 19:19:00 2024 rev:197 rq:1218108 version:1.14.4

Changes:
--------
--- /work/SRC/openSUSE:Factory/subversion/subversion.changes    2024-10-23 
21:08:01.737087953 +0200
+++ /work/SRC/openSUSE:Factory/.subversion.new.2020/subversion.changes  
2024-10-25 19:19:34.086439850 +0200
@@ -1,0 +2,7 @@
+Thu Oct 24 15:20:32 UTC 2024 - Andreas Stieger <andreas.stie...@gmx.de>
+
+- Fix build with Swig 4.3.0 (boo#1231590)
+  * subversion-1.14.4-swig-4.3.0-swig-py.patch
+  * subversion-1.14.4-swig-4.3.0-swig-rb.patch
+
+-------------------------------------------------------------------

New:
----
  subversion-1.14.4-swig-4.3.0-swig-py.patch
  subversion-1.14.4-swig-4.3.0-swig-rb.patch

BETA DEBUG BEGIN:
  New:- Fix build with Swig 4.3.0 (boo#1231590)
  * subversion-1.14.4-swig-4.3.0-swig-py.patch
  * subversion-1.14.4-swig-4.3.0-swig-rb.patch
  New:  * subversion-1.14.4-swig-4.3.0-swig-py.patch
  * subversion-1.14.4-swig-4.3.0-swig-rb.patch
BETA DEBUG END:

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

Other differences:
------------------
++++++ subversion.spec ++++++
--- /var/tmp/diff_new_pack.dUY1Ae/_old  2024-10-25 19:19:36.282531477 +0200
+++ /var/tmp/diff_new_pack.dUY1Ae/_new  2024-10-25 19:19:36.286531644 +0200
@@ -75,6 +75,8 @@
 # PATCH-FIX-UPSTREAM danilo.spine...@suse.com bsc#1195486 bsc#1193778
 # Fix testCrash_RequestChannel_nativeRead_AfterException test on aarch64 and 
ppc64le
 Patch47:        fix-javahl-test.patch
+Patch48:        subversion-1.14.4-swig-4.3.0-swig-py.patch
+Patch49:        subversion-1.14.4-swig-4.3.0-swig-rb.patch
 BuildRequires:  apache-rpm-macros
 BuildRequires:  apache2-devel >= 2.2.0
 BuildRequires:  apache2-prefork

++++++ subversion-1.14.4-swig-4.3.0-swig-py.patch ++++++
------------------------------------------------------------------------
r1921523 | jun66j5 | 2024-10-24 05:11:00 +0200 (Thu, 24 Oct 2024) | 3 lines
Changed paths:
   M /subversion/branches/1.14.x-r1921505
   M 
/subversion/branches/1.14.x-r1921505/subversion/bindings/swig/include/svn_types.swg
   M 
/subversion/branches/1.14.x-r1921505/subversion/bindings/swig/python/tests/client.py
   M 
/subversion/branches/1.14.x-r1921505/subversion/bindings/swig/python/tests/core.py

On the 1.14.x-r1921505 branch: Merge r1921505 from trunk without changes for
`%typemap() svn_error_t * SVN_ERR_WITH_ATTRS`.

------------------------------------------------------------------------
Index: 1.14.x-r1921505/subversion/bindings/swig/include/svn_types.swg
===================================================================
--- 1.14.x-r1921505/subversion/bindings/swig/include/svn_types.swg      
(revision 1921522)
+++ 1.14.x-r1921505/subversion/bindings/swig/include/svn_types.swg      
(revision 1921523)
@@ -435,9 +435,32 @@
             svn_error_clear($1);
         SWIG_fail;
     }
-    Py_INCREF(Py_None);
-    $result = Py_None;
+    Py_XDECREF($result);
+    $result = PyList_New(0);
 }
+
+%typemap(ret) svn_error_t * {
+    if ($result == NULL) {
+      $result = Py_None;
+      Py_INCREF($result);
+    }
+    else {
+      switch (PyList_Size($result)) {
+        case 0:
+          $result = Py_None;
+          Py_INCREF($result);
+          break;
+        case 1:
+          {
+            PyObject *tmp = $result;
+            $result = PyList_GetItem(tmp, 0);
+            Py_INCREF($result);
+            Py_DECREF(tmp);
+          }
+          break;
+      }
+    }
+}
 #endif
 
 #ifdef SWIGPERL
Index: 1.14.x-r1921505/subversion/bindings/swig/python/tests/client.py
===================================================================
--- 1.14.x-r1921505/subversion/bindings/swig/python/tests/client.py     
(revision 1921522)
+++ 1.14.x-r1921505/subversion/bindings/swig/python/tests/client.py     
(revision 1921523)
@@ -172,7 +172,9 @@
 
     path = self.temper.alloc_empty_dir('-checkout')
 
-    self.assertRaises(ValueError, client.checkout2,
+    # TypeError is raised since SWIG 4.3.0
+    self.assertRaises((ValueError, TypeError), r'Received a NULL pointer',
+                      client.checkout2,
                       self.repos_uri, path, None, None, True, True,
                       self.client_ctx)
 
@@ -526,7 +528,9 @@
 
     path = self.temper.alloc_empty_dir('-update')
 
-    self.assertRaises(ValueError, client.checkout2,
+    # TypeError is raised since SWIG 4.3.0
+    self.assertRaises((ValueError, TypeError), r'Received a NULL pointer',
+                      client.checkout2,
                       self.repos_uri, path, None, None, True, True,
                       self.client_ctx)
 
Index: 1.14.x-r1921505/subversion/bindings/swig/python/tests/core.py
===================================================================
--- 1.14.x-r1921505/subversion/bindings/swig/python/tests/core.py       
(revision 1921522)
+++ 1.14.x-r1921505/subversion/bindings/swig/python/tests/core.py       
(revision 1921523)
@@ -333,7 +333,35 @@
                      [b'', 1])
     svn.core.svn_stream_close(stream)
 
+  def test_svn_rangelist_diff(self):
+    """
+    SWIG incorrectly handles return values when the first %append_output() is
+    invoked with a list instance. svn.core.svn_rangelist_diff() is in the case.
+    We test whether the workaround for it is working.
+    """
 
+    def from_args(start, end, inheritable):
+      instance = svn.core.svn_merge_range_t()
+      instance.start = start
+      instance.end = end
+      instance.inheritable = inheritable
+      return instance
+
+    def to_args(instance):
+      return [instance.start, instance.end, instance.inheritable]
+
+    def map_list(f, iterator):
+      return list(map(f, iterator))
+
+    from_ = [from_args(4, 5, True), from_args(9, 13, True)]
+    to = [from_args(7, 11, True)]
+    rv = svn.core.svn_rangelist_diff(from_, to, True)
+    self.assertIsInstance(rv, (list, tuple))
+    deleted, added = rv
+    self.assertEqual([[7, 9, True]], map_list(to_args, added))
+    self.assertEqual([[4, 5, True], [11, 13, True]],map_list(to_args, deleted))
+
+
 def suite():
     return unittest.defaultTestLoader.loadTestsFromTestCase(
       SubversionCoreTestCase)
Index: 1.14.x-r1921505
===================================================================
--- 1.14.x-r1921505     (revision 1921522)
+++ 1.14.x-r1921505     (revision 1921523)

Property changes on: 1.14.x-r1921505
___________________________________________________________________
Modified: svn:mergeinfo
## -0,0 +0,1 ##
   Merged /subversion/trunk:r1921505

++++++ subversion-1.14.4-swig-4.3.0-swig-rb.patch ++++++
------------------------------------------------------------------------
r1921506 | jun66j5 | 2024-10-23 12:44:41 +0200 (Wed, 23 Oct 2024) | 27 lines
Changed paths:
   M /subversion/trunk/subversion/bindings/swig/include/svn_containers.swg
   M /subversion/trunk/subversion/bindings/swig/include/svn_types.swg
   M /subversion/trunk/subversion/bindings/swig/ruby/svn/core.rb
   M /subversion/trunk/subversion/bindings/swig/svn_wc.i

Make swig-rb compatible with SWIG 4.3.0.

* subversion/bindings/swig/include/svn_containers.swg
  (%typemap(out) apr_hash_t *PROPHASH,
   %typemap(out) apr_hash_t *CHANGED_PATH_HASH,
   %typemap(out) apr_array_header_t *PROP_LIST,
   %typemap(out) apr_array_header_t *PROP_LIST_MAY_BE_NULL):
    Set the return value to `$result` rather than using `%append_output` in
    `%typemap(out)` for Ruby.

* subversion/bindings/swig/include/svn_types.swg
  (%typemap(out) svn_error_t *):
    Initialize `$result` with an empty array for the workaround to
    `%append_output` incorrectly handling for nil and a list in Ruby.

  (%typemap(ret) svn_error_t *):
    Use first entry for `$result` when the size of the `$result` list is 1.

* subversion/bindings/swig/ruby/svn/core.rb
  (Svn::Core::RangeList.diff):
    Revised because multiple values are correctly retrieved from SWIG methods
    now.

* subversion/bindings/swig/svn_wc.i
  (%typemap(ret) svn_error_t *err):
    Added because `%typemap(out) svn_error_t *err` is defined.

------------------------------------------------------------------------
Index: trunk/subversion/bindings/swig/include/svn_containers.swg
===================================================================
--- trunk/subversion/bindings/swig/include/svn_containers.swg   (revision 
1921505)
+++ trunk/subversion/bindings/swig/include/svn_containers.swg   (revision 
1921506)
@@ -310,7 +310,7 @@
 
 %typemap(out) apr_hash_t *PROPHASH
 {
-  %append_output(svn_swig_rb_apr_hash_to_hash_svn_string($1));
+  $result = svn_swig_rb_apr_hash_to_hash_svn_string($1);
 }
 #endif
 
@@ -326,10 +326,8 @@
 #ifdef SWIGRUBY
 %typemap(out) apr_hash_t *CHANGED_PATH_HASH
 {
-  VALUE rb_changed_path_hash;
-  rb_changed_path_hash =
+  $result =
     svn_swig_rb_apr_hash_to_hash_swig_type($1, "svn_log_changed_path_t *");
-  %append_output(rb_changed_path_hash);
 }
 
 %apply apr_hash_t *CHANGED_PATH_HASH {
@@ -760,7 +758,7 @@
 
 %typemap(out) apr_array_header_t *PROP_LIST
 {
-  %append_output(svn_swig_rb_prop_apr_array_to_hash_prop($1));
+  $result = svn_swig_rb_prop_apr_array_to_hash_prop($1);
 }
 
 %typemap(in) apr_array_header_t *PROP_LIST_MAY_BE_NULL
@@ -778,7 +776,7 @@
 
 %typemap(out) apr_array_header_t *PROP_LIST_MAY_BE_NULL
 {
-  %append_output($1 ? svn_swig_rb_prop_apr_array_to_hash_prop($1) : Qnil);
+  $result = $1 ? svn_swig_rb_prop_apr_array_to_hash_prop($1) : Qnil;
 }
 
 %apply apr_array_header_t *PROP_LIST {
Index: trunk/subversion/bindings/swig/include/svn_types.swg
===================================================================
--- trunk/subversion/bindings/swig/include/svn_types.swg        (revision 
1921505)
+++ trunk/subversion/bindings/swig/include/svn_types.swg        (revision 
1921506)
@@ -532,7 +532,7 @@
 #endif
 
 #ifdef SWIGRUBY
-%typemap(out) svn_error_t *
+%typemap(out) svn_error_t * (VALUE *svn_presult = NULL)
 {
   if ($1) {
     svn_swig_rb_destroy_pool(_global_svn_swig_rb_pool);
@@ -539,8 +539,23 @@
     svn_swig_rb_pop_pool(_global_svn_swig_rb_pool);
     svn_swig_rb_handle_svn_error($1);
   }
-  $result = Qnil;
+  $result = rb_ary_new();
+  svn_presult = &$result;
 }
+
+%typemap(ret) svn_error_t *
+{
+  if (TYPE(*svn_presult) == T_ARRAY) {
+    switch (rb_array_len(*svn_presult)) {
+      case 0:
+        *svn_presult = Qnil;
+        break;
+      case 1:
+        *svn_presult = rb_ary_entry(*svn_presult, 0);
+        break;
+    }
+  }
+}
 #endif
 
 /* -----------------------------------------------------------------------
Index: trunk/subversion/bindings/swig/ruby/svn/core.rb
===================================================================
--- trunk/subversion/bindings/swig/ruby/svn/core.rb     (revision 1921505)
+++ trunk/subversion/bindings/swig/ruby/svn/core.rb     (revision 1921506)
@@ -812,7 +812,7 @@
       def diff(to, consider_inheritance=false)
         result = Core.rangelist_diff(self, to, consider_inheritance)
         deleted = result.pop
-        added = result
+        added = result.pop
         [added, deleted].collect do |result|
           self.class.new(*result)
         end
Index: trunk/subversion/bindings/swig/svn_wc.i
===================================================================
--- trunk/subversion/bindings/swig/svn_wc.i     (revision 1921505)
+++ trunk/subversion/bindings/swig/svn_wc.i     (revision 1921506)
@@ -242,6 +242,8 @@
 {
   $result = $1 ? svn_swig_rb_svn_error_to_rb_error($1) : Qnil;
 }
+
+%typemap(ret) svn_error_t *err "";
 #endif
 
 

Reply via email to