Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package yast2-perl-bindings for 
openSUSE:Factory checked in at 2022-07-13 13:44:41
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/yast2-perl-bindings (Old)
 and      /work/SRC/openSUSE:Factory/.yast2-perl-bindings.new.1523 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "yast2-perl-bindings"

Wed Jul 13 13:44:41 2022 rev:47 rq:988660 version:4.5.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/yast2-perl-bindings/yast2-perl-bindings.changes  
2022-04-14 17:24:40.303207725 +0200
+++ 
/work/SRC/openSUSE:Factory/.yast2-perl-bindings.new.1523/yast2-perl-bindings.changes
        2022-07-13 13:44:41.793972927 +0200
@@ -1,0 +2,7 @@
+Tue Jul 12 12:20:50 UTC 2022 - Stefan Hundhammer <shundham...@suse.com>
+
+- Adapted to new Perl-5.36.0 API (bsc#1200990)
+  Details: https://github.com/yast/yast-perl-bindings/pull/30
+- 4.5.1
+
+-------------------------------------------------------------------

Old:
----
  yast2-perl-bindings-4.5.0.tar.bz2

New:
----
  yast2-perl-bindings-4.5.1.tar.bz2

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

Other differences:
------------------
++++++ yast2-perl-bindings.spec ++++++
--- /var/tmp/diff_new_pack.669TNq/_old  2022-07-13 13:44:42.297973642 +0200
+++ /var/tmp/diff_new_pack.669TNq/_new  2022-07-13 13:44:42.305973654 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-perl-bindings
-Version:        4.5.0
+Version:        4.5.1
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build

++++++ yast2-perl-bindings-4.5.0.tar.bz2 -> yast2-perl-bindings-4.5.1.tar.bz2 
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-perl-bindings-4.5.0/doc/examples/Makefile.am.old 
new/yast2-perl-bindings-4.5.1/doc/examples/Makefile.am.old
--- old/yast2-perl-bindings-4.5.0/doc/examples/Makefile.am.old  2022-04-12 
13:36:34.000000000 +0200
+++ new/yast2-perl-bindings-4.5.1/doc/examples/Makefile.am.old  1970-01-01 
01:00:00.000000000 +0100
@@ -1,30 +0,0 @@
-#
-# Makefile.am for perl-bindings/doc/examples
-#
-# making the examples currently needs that
-# "make -C ../../src install" has run
-# so for build it is excluded from SUBDIRS in ../Makefile.am
-
-include Makefile.am.common
-
-ycp_examplesdir =      $(docdir)/examples
-perl_examplesdir =     $(docdir)/examples
-
-FIXME
-
-ycp_examples_DATA =
-
-#for dependencies
-module_DATA =                                  \
-       doimport.ycp                            \
-       example.ycp                             \
-       foo.ycp                                 \
-       import.ycp                              \
-       import2.ycp                             \
-       intermediate.ycp
-
-perl_examples_DATA =                           \
-       dummy.pm                                \
-       imported.pm
-
-EXTRA_DIST = $(ycp_examples_DATA) $(perl_examples_DATA)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-perl-bindings-4.5.0/doc/examples/run_scalar_types_test 
new/yast2-perl-bindings-4.5.1/doc/examples/run_scalar_types_test
--- old/yast2-perl-bindings-4.5.0/doc/examples/run_scalar_types_test    
1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-perl-bindings-4.5.1/doc/examples/run_scalar_types_test    
2022-07-12 17:07:29.000000000 +0200
@@ -0,0 +1,2 @@
+#!/bin/sh
+Y2DIR=.. /usr/lib/YaST2/bin/y2start ./scalar_types_test.ycp qt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-perl-bindings-4.5.0/doc/examples/scalar_types_test.ycp 
new/yast2-perl-bindings-4.5.1/doc/examples/scalar_types_test.ycp
--- old/yast2-perl-bindings-4.5.0/doc/examples/scalar_types_test.ycp    
1970-01-01 01:00:00.000000000 +0100
+++ new/yast2-perl-bindings-4.5.1/doc/examples/scalar_types_test.ycp    
2022-07-12 17:07:29.000000000 +0200
@@ -0,0 +1,67 @@
+// Simple manual test for correct type conversions of Perl scalar values
+//
+// Start with
+//
+//    Y2DIR=.. /usr/lib/YaST2/bin/y2start ./scalar_types_test.ycp qt
+//
+// Since modules are imported from the $Y2DIR/modules directory, the Perl
+// module that we import is in ../modules, and we need to tell the YaST
+// framework where that Y2DIR is: One directory level up from here.
+//
+// This test uses the y2log for its output.
+//
+// For more details, see
+//   https://github.com/yast/yast-perl-bindings/pull/30
+
+{
+    import "ScalarTypes";       // ../modules/ScalarTypes.pm
+
+    void log_str( string test_name, string value )
+    {
+        y2milestone( "*** Result of test %1: %2", test_name, value );
+    }
+
+    
+    void log_any( string test_name, any value, boolean type_ok )
+    {
+        if ( type_ok )
+        {
+            y2milestone( "*** Result of test %1: %2", test_name, value );
+        }
+        else
+        {
+            y2error( "*** ERROR: Wrong result type in test %1: %2", test_name, 
value );
+        }
+    }
+
+
+    string hello  = ScalarTypes::hello();
+    log_str( "hello", hello );
+
+    string str_int = ScalarTypes::str_int();
+    log_str( "str_int", str_int );
+
+    string str_float = ScalarTypes::str_float();
+    log_str( "str_float", str_float );
+
+    
+    integer int_val = ScalarTypes::int_val();
+    log_any( "int_val", int_val, is( int_val, integer ) );
+    
+    float float_val = ScalarTypes::float_val();
+    log_any( "float_val", float_val, is( float_val, float ) );
+
+
+    any any_str = ScalarTypes::any_str();
+    log_any( "any_str", any_str, is( any_str, string ) );
+
+
+    // Our Perl bindings intentionally treat all YCP 'any' values as strings.
+    // See ../../src/YPerl.cc
+    
+    any any_int = ScalarTypes::any_int();
+    log_any( "any_int", any_int, is( any_int, string ) );
+    
+    any any_float = ScalarTypes::any_float();
+    log_any( "any_float", any_float, is( any_float, string ) );
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-perl-bindings-4.5.0/doc/modules/Makefile.am 
new/yast2-perl-bindings-4.5.1/doc/modules/Makefile.am
--- old/yast2-perl-bindings-4.5.0/doc/modules/Makefile.am       2022-04-12 
13:36:34.000000000 +0200
+++ new/yast2-perl-bindings-4.5.1/doc/modules/Makefile.am       2022-07-12 
17:07:29.000000000 +0200
@@ -1,4 +1,4 @@
 pmdir = $(docdir)/modules
-pm_DATA = PerlHello.pm PerlFunc.pm
+pm_DATA = PerlHello.pm PerlFunc.pm ScalarTypes.pm
 
 EXTRA_DIST = $(pm_DATA)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-perl-bindings-4.5.0/doc/modules/ScalarTypes.pm 
new/yast2-perl-bindings-4.5.1/doc/modules/ScalarTypes.pm
--- old/yast2-perl-bindings-4.5.0/doc/modules/ScalarTypes.pm    1970-01-01 
01:00:00.000000000 +0100
+++ new/yast2-perl-bindings-4.5.1/doc/modules/ScalarTypes.pm    2022-07-12 
17:07:29.000000000 +0200
@@ -0,0 +1,80 @@
+#! /usr/bin/perl -w
+#
+# Perl module to test scalar types with the yast-perl-bindings.
+
+use strict;
+use English;
+
+package ScalarTypes;
+
+our %TYPEINFO;
+
+
+# BEGIN { print "Executing ScalarTypes module BEGIN block\n"; }
+# END   { print "Executing ScalarTypes module END block\n";   }
+
+
+BEGIN { $TYPEINFO{ hello } = [ "function", "string" ]; }
+sub hello()
+{
+    return "hello";
+}
+
+
+# Perl implicitly converts values that look like numbers to a numeric scalar,
+# even if it's in a string. This can be used to test the yast-perl-bindings
+# that should use a string when a YCPString was requested.
+
+BEGIN { $TYPEINFO{ str_int } = [ "function", "string" ]; }
+sub str_int()
+{
+    return "42";
+}
+
+
+BEGIN { $TYPEINFO{ str_float } = [ "function", "string" ]; }
+sub str_float()
+{
+    return "42.84";
+}
+
+
+
+BEGIN { $TYPEINFO{ int_val } = [ "function", "integer" ]; }
+sub int_val()
+{
+    return 42;
+}
+
+
+BEGIN { $TYPEINFO{ float_val } = [ "function", "float" ]; }
+sub float_val
+{
+    return 42.84;
+}
+
+
+
+BEGIN { $TYPEINFO{ any_str } = [ "function", "any" ]; }
+sub any_str()
+{
+    return "foo";
+}
+
+
+BEGIN { $TYPEINFO{ any_int } = [ "function", "any" ]; }
+sub any_int()
+{
+    return 42;
+}
+
+
+BEGIN { $TYPEINFO{ any_float } = [ "function", "any" ]; }
+sub any_float()
+{
+    return 42.84;
+}
+
+
+# Return value
+1;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-perl-bindings-4.5.0/package/yast2-perl-bindings.changes 
new/yast2-perl-bindings-4.5.1/package/yast2-perl-bindings.changes
--- old/yast2-perl-bindings-4.5.0/package/yast2-perl-bindings.changes   
2022-04-12 13:36:34.000000000 +0200
+++ new/yast2-perl-bindings-4.5.1/package/yast2-perl-bindings.changes   
2022-07-12 17:07:29.000000000 +0200
@@ -1,4 +1,11 @@
 -------------------------------------------------------------------
+Tue Jul 12 12:20:50 UTC 2022 - Stefan Hundhammer <shundham...@suse.com>
+
+- Adapted to new Perl-5.36.0 API (bsc#1200990)
+  Details: https://github.com/yast/yast-perl-bindings/pull/30
+- 4.5.1
+
+-------------------------------------------------------------------
 Wed Apr 06 13:24:58 UTC 2022 - Ladislav Slez??k <lsle...@suse.cz>
 
 - Bump version to 4.5.0 (bsc#1198109)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/yast2-perl-bindings-4.5.0/package/yast2-perl-bindings.spec 
new/yast2-perl-bindings-4.5.1/package/yast2-perl-bindings.spec
--- old/yast2-perl-bindings-4.5.0/package/yast2-perl-bindings.spec      
2022-04-12 13:36:34.000000000 +0200
+++ new/yast2-perl-bindings-4.5.1/package/yast2-perl-bindings.spec      
2022-07-12 17:07:29.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           yast2-perl-bindings
-Version:        4.5.0
+Version:        4.5.1
 Release:        0
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/yast2-perl-bindings-4.5.0/src/YPerl.cc 
new/yast2-perl-bindings-4.5.1/src/YPerl.cc
--- old/yast2-perl-bindings-4.5.0/src/YPerl.cc  2022-04-12 13:36:34.000000000 
+0200
+++ new/yast2-perl-bindings-4.5.1/src/YPerl.cc  2022-07-12 17:07:29.000000000 
+0200
@@ -259,14 +259,14 @@
     SAVETMPS;          // Save temporary variables
     PUSHMARK(SP);      // Save stack pointer
 
-    
+
     // For class method calls put the class name on the stack first
-    
+
     if (method)
     {
        XPUSHs( sv_2mortal( newSVpv( module.c_str(), 0 ) ) );
     }
-    
+
 
     // Put arguments on the stack
     SV **svs = new SV*[argList->size()];
@@ -286,7 +286,7 @@
 
     string full_name = module + "::" + function;
     int ret_count = 0;
-    
+
     // G_EVAL: prevent errors from making Perl (and the rest of YaST) die
     // (FATE 412)
     // so far we use static methods, so call_pv is enough
@@ -397,7 +397,7 @@
 YPerl::newPerlScalar( const YCPValue & xval, bool composite )
 {
     EMBEDDED_PERL_DEFS;
-    
+
     YCPValue val = xval;
     if ( val->isReference()) {
        val = val->asReference()->entry()->value();
@@ -671,7 +671,7 @@
 {
     SV * ref = SvRV(sv);
     SvREFCNT_inc(ref);
-    
+
     YCPExternal ex(ref, string(YCP_EXTERNAL_MAGIC), &perl_class_destructor);
     out = ex;
 }
@@ -895,12 +895,17 @@
        {
            if (SvROK(sv))
                sv = SvRV(sv);
-           // Perl relies on automatic coercion between strings and numbers
-           // So to behave more like it,
-           // instead of "if (SvXOK (sv)) SvXV (sv)"
-           // we first SvXV (sv) and only then SvXOK.
+
            const char *pv = SvPV_nolen (sv);
-           if (SvPOK (sv))
+
+           // Perl uses automatic coercion between strings and numbers,
+            // but when we expect a string, we really want a string.
+            //
+            // bsc#1200990: From Perl 5.36.0 on, it no longer always sets
+            // SvPOK() if it's a numeric type (int or float), so we need to
+            // check those other two cases as well.
+
+            if ( SvPOK(sv) || SvIOK(sv) || SvNOK(sv) )
            {
                val = YCPString (pv);
            }
@@ -959,6 +964,7 @@
        {
            // see isString
            const char *pv = SvPV_nolen (sv);
+
            if (SvPOK (sv))
            {
                val = YCPSymbol (pv);
@@ -1153,7 +1159,7 @@
     {
        sv_args[i] = sv_2mortal (newPerlScalar (args->value (i), false ));
     }
-    
+
     PUSHMARK (SP);
 
     // Class name
@@ -1211,7 +1217,8 @@
     // use the explicit data classes YaST::YCP::Integer.
 
     const char *pv = SvPV_nolen (sv);
-    if (SvPOK (sv))
+
+    if ( SvPOK(sv) || SvIOK(sv) || SvNOK(sv) ) // bsc#1200990
     {
        val = YCPString (pv);
     }

Reply via email to