Hello community,

here is the log from the commit of package perl-Clone for openSUSE:Factory 
checked in at 2018-11-12 09:38:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Clone (Old)
 and      /work/SRC/openSUSE:Factory/.perl-Clone.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-Clone"

Mon Nov 12 09:38:39 2018 rev:28 rq:647337 version:0.41

Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Clone/perl-Clone.changes    2017-04-12 
18:16:32.659173685 +0200
+++ /work/SRC/openSUSE:Factory/.perl-Clone.new/perl-Clone.changes       
2018-11-12 09:39:01.833394977 +0100
@@ -1,0 +2,17 @@
+Thu Nov  8 06:07:26 UTC 2018 - Stephan Kulow <[email protected]>
+
+- updated to 0.41
+   see /usr/share/doc/packages/perl-Clone/Changes
+
+  0.41 2018-10-25 10:20:03  garu
+    - Check the CowREFCNT of a COWed PV (ATOOMIC)
+      this should fix some issues people have been
+      having with 0.40 on DBD drives and DBIx::Class
+    - Make buildtools files not executable (Mohammad S Anwar)
+  
+  0.40 2018-10-23 20:001:49  garu
+    - reuse COWed PV when cloning (fixes RT97535) (ATOOMIC)
+    - extra protection against potential infinite loop (ATOOMIC)
+    - improved tests
+
+-------------------------------------------------------------------

Old:
----
  Clone-0.39.tar.gz

New:
----
  Clone-0.41.tar.gz

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

Other differences:
------------------
++++++ perl-Clone.spec ++++++
--- /var/tmp/diff_new_pack.aQspXO/_old  2018-11-12 09:39:03.689392311 +0100
+++ /var/tmp/diff_new_pack.aQspXO/_new  2018-11-12 09:39:03.689392311 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package perl-Clone
 #
-# 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
@@ -12,18 +12,18 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
 
 Name:           perl-Clone
-Version:        0.39
+Version:        0.41
 Release:        0
 %define cpan_name Clone
 Summary:        Recursively Copy Perl Datatypes
-License:        Artistic-1.0 or GPL-1.0+
+License:        Artistic-1.0 OR GPL-1.0-or-later
 Group:          Development/Libraries/Perl
-Url:            http://search.cpan.org/dist/Clone/
+Url:            https://metacpan.org/release/%{cpan_name}
 Source0:        
https://cpan.metacpan.org/authors/id/G/GA/GARU/%{cpan_name}-%{version}.tar.gz
 Source1:        cpanspec.yml
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
@@ -50,7 +50,7 @@
 find . -type f ! -name \*.pl -print0 | xargs -0 chmod 644
 
 %build
-%{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
+perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
 %{__make} %{?_smp_mflags}
 
 %check
@@ -63,6 +63,6 @@
 
 %files -f %{name}.files
 %defattr(-,root,root,755)
-%doc Changes README
+%doc Changes
 
 %changelog

++++++ Clone-0.39.tar.gz -> Clone-0.41.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Clone-0.39/Changes new/Clone-0.41/Changes
--- old/Clone-0.39/Changes      2017-04-07 13:11:24.000000000 +0200
+++ new/Clone-0.41/Changes      2018-10-25 15:32:34.000000000 +0200
@@ -1,5 +1,16 @@
 Revision history for Perl module Clone
 
+0.41 2018-10-25 10:20:03  garu
+  - Check the CowREFCNT of a COWed PV (ATOOMIC)
+    this should fix some issues people have been
+    having with 0.40 on DBD drives and DBIx::Class
+  - Make buildtools files not executable (Mohammad S Anwar)
+
+0.40 2018-10-23 20:001:49  garu
+  - reuse COWed PV when cloning (fixes RT97535) (ATOOMIC)
+  - extra protection against potential infinite loop (ATOOMIC)
+  - improved tests
+
 0.39 2017-04-07 13:06:00  garu
   - use explicit '.' in tests since it may not be in @INC
     anymore in newer perls (fixes RT120648) (PLICEASE, SIMCOP)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Clone-0.39/Clone.pm new/Clone-0.41/Clone.pm
--- old/Clone-0.39/Clone.pm     2017-04-07 13:11:56.000000000 +0200
+++ new/Clone-0.41/Clone.pm     2018-10-25 15:22:15.000000000 +0200
@@ -11,7 +11,7 @@
 @EXPORT    = qw();
 @EXPORT_OK = qw( clone );
 
-$VERSION = '0.39';
+$VERSION = '0.41';
 
 bootstrap Clone $VERSION;
 
@@ -81,7 +81,7 @@
 
 =head1 COPYRIGHT
 
-Copyright 2001-2017 Ray Finch. All Rights Reserved.
+Copyright 2001-2018 Ray Finch. All Rights Reserved.
 
 This module is free software; you can redistribute it and/or
 modify it under the same terms as Perl itself.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Clone-0.39/Clone.xs new/Clone-0.41/Clone.xs
--- old/Clone-0.39/Clone.xs     2014-05-10 15:35:11.000000000 +0200
+++ new/Clone-0.41/Clone.xs     2018-10-25 15:19:31.000000000 +0200
@@ -170,7 +170,39 @@
 #endif
       case SVt_PV:             /* 4 */
         TRACEME(("string scalar\n"));
+/*
+* Note: when using a Debug Perl with READONLY_COW
+* we cannot do 'sv_buf_to_rw + sv_buf_to_ro' as these APIs calls are not 
exported
+*/
+#if PERL_VERSION >= 20 && !defined(PERL_DEBUG_READONLY_COW)
+        /* only for simple PVs unblessed */
+        if ( SvIsCOW(ref) && !SvOOK(ref) && SvLEN(ref) > 0
+            && CowREFCNT(ref) < SV_COW_REFCNT_MAX ) {
+          /* cannot use newSVpv_share as this going to use a new PV we do not 
want to clone it */
+          /* create a fresh new PV */
+          clone = newSV(0);
+          sv_upgrade(clone, SVt_PV);
+          SvPOK_on(clone);
+          SvIsCOW_on(clone);
+
+          /* points the str slot to the COWed one */
+          SvPV_set(clone, SvPVX(ref) );
+          CowREFCNT(ref)++;
+
+          /* preserve cur, len, flags and utf8 flag */
+          SvCUR_set(clone, SvCUR(ref));
+          SvLEN_set(clone, SvLEN(ref));
+          //SvFLAGS(clone) = SvFLAGS(ref);
+
+          if (SvUTF8(ref))
+            SvUTF8_on(clone);
+
+        } else {
+          clone = newSVsv (ref);
+        }
+#else
         clone = newSVsv (ref);
+#endif
         break;
       case SVt_PVIV:           /* 5 */
         TRACEME (("PVIV double-type\n"));
@@ -210,8 +242,8 @@
     * to properly handle circular references. cb 2001-02-06
     */
 
-  if ( visible )
-    CLONE_STORE(ref,clone);
+  if ( visible && ref != clone )
+      CLONE_STORE(ref,clone);
 
     /*
      * We'll assume (in the absence of evidence to the contrary) that A) a
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Clone-0.39/META.json new/Clone-0.41/META.json
--- old/Clone-0.39/META.json    2017-04-07 13:22:02.000000000 +0200
+++ new/Clone-0.41/META.json    2018-10-25 15:34:23.000000000 +0200
@@ -4,13 +4,13 @@
       "Ray Finch <[email protected]>"
    ],
    "dynamic_config" : 1,
-   "generated_by" : "ExtUtils::MakeMaker version 7.1002, CPAN::Meta::Converter 
version 2.150005",
+   "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter 
version 2.150010",
    "license" : [
       "perl_5"
    ],
    "meta-spec" : {
       "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec";,
-      "version" : "2"
+      "version" : 2
    },
    "name" : "Clone",
    "no_index" : {
@@ -29,15 +29,12 @@
          "requires" : {
             "ExtUtils::MakeMaker" : "0"
          }
-      },
-      "runtime" : {
-         "requires" : {}
       }
    },
    "release_status" : "stable",
    "resources" : {
       "bugtracker" : {
-         "web" : "http://rt.cpan.org/NoAuth/Bugs.html?Dist=Clone";
+         "web" : "https://github.com/garu/Clone/issues";
       },
       "license" : [
          "http://dev.perl.org/licenses/";
@@ -46,6 +43,6 @@
          "url" : "http://github.com/garu/Clone";
       }
    },
-   "version" : "0.39",
-   "x_serialization_backend" : "JSON::PP version 2.27300_01"
+   "version" : "0.41",
+   "x_serialization_backend" : "JSON::PP version 2.97001"
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Clone-0.39/META.yml new/Clone-0.41/META.yml
--- old/Clone-0.39/META.yml     2017-04-07 13:22:01.000000000 +0200
+++ new/Clone-0.41/META.yml     2018-10-25 15:34:22.000000000 +0200
@@ -7,7 +7,7 @@
 configure_requires:
   ExtUtils::MakeMaker: '0'
 dynamic_config: 1
-generated_by: 'ExtUtils::MakeMaker version 7.1002, CPAN::Meta::Converter 
version 2.150005'
+generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 
2.150010'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -17,10 +17,9 @@
   directory:
     - t
     - inc
-requires: {}
 resources:
-  bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=Clone
+  bugtracker: https://github.com/garu/Clone/issues
   license: http://dev.perl.org/licenses/
   repository: http://github.com/garu/Clone
-version: '0.39'
+version: '0.41'
 x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Clone-0.39/Makefile.PL new/Clone-0.41/Makefile.PL
--- old/Clone-0.39/Makefile.PL  2014-05-10 15:36:17.000000000 +0200
+++ new/Clone-0.41/Makefile.PL  2018-10-25 15:23:04.000000000 +0200
@@ -19,7 +19,7 @@
     META_MERGE      => {
       resources => {
         license    => 'http://dev.perl.org/licenses/',
-        bugtracker => 'http://rt.cpan.org/NoAuth/Bugs.html?Dist=Clone',
+        bugtracker => 'https://github.com/garu/Clone/issues',
         repository => 'http://github.com/garu/Clone',
       },
     },
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Clone-0.39/README new/Clone-0.41/README
--- old/Clone-0.39/README       2017-04-07 13:12:29.000000000 +0200
+++ new/Clone-0.41/README       1970-01-01 01:00:00.000000000 +0100
@@ -1,78 +0,0 @@
-Clone - recursively copy Perl datatypes
-=======================================
-
-[![Build 
Status](https://travis-ci.org/garu/Clone.png?branch=master)](https://travis-ci.org/garu/Clone)
-[![Coverage 
Status](https://coveralls.io/repos/garu/Clone/badge.png?branch=master)](https://coveralls.io/r/garu/Clone?branch=master)
-[![CPAN 
version](https://badge.fury.io/pl/Clone.svg)](https://metacpan.org/pod/Clone)
-
-This module provides a `clone()` method which makes recursive
-copies of nested hash, array, scalar and reference types,
-including tied variables and objects.
-
-```perl
-    use Clone 'clone';
-
-    my $data = {
-       set => [ 1 .. 50 ],
-       foo => {
-           answer => 42,
-           object => SomeObject->new,
-       },
-    };
-
-    my $cloned_data = clone($data);
-
-    $cloned_data->{foo}{answer} = 1;
-    print $cloned_data->{foo}{answer};  # '1'
-    print $data->{foo}{answer};         # '42'
-```
-
-You can also add it to your class:
-
-```perl
-    package Foo;
-    use parent 'Clone';
-    sub new { bless {}, shift }
-
-    package main;
-
-    my $obj = Foo->new;
-    my $copy = $obj->clone;
-```
-
-`clone()` takes a scalar argument and duplicates it. To duplicate lists,
-arrays or hashes, pass them in by reference, e.g.
-
-```perl
-    my $copy = clone (\@array);
-
-    # or
-
-    my %copy = %{ clone (\%hash) };
-```
-
-See Also
---------
-
-[Storable](https://metacpan.org/pod/Storable)'s `dclone()` is a flexible 
solution for cloning variables,
-albeit slower for average-sized data structures. Simple
-and naive benchmarks show that Clone is faster for data structures
-with 3 or fewer levels, while `dclone()` can be faster for structures
-4 or more levels deep.
-
-COPYRIGHT
----------
-
-Copyright 2001-2017 Ray Finch. All Rights Reserved.
-
-This module is free software; you can redistribute it and/or
-modify it under the same terms as Perl itself.
-
-AUTHOR
-------
-
-Ray Finch `<[email protected]>`
-
-Breno G. de Oliveira `<[email protected]>` and
-Florian Ragwitz `<[email protected]>` perform routine maintenance
-releases since 2012.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Clone-0.39/t/03scalar.t new/Clone-0.41/t/03scalar.t
--- old/Clone-0.39/t/03scalar.t 2014-05-10 15:33:02.000000000 +0200
+++ new/Clone-0.41/t/03scalar.t 2018-10-25 15:19:31.000000000 +0200
@@ -7,10 +7,14 @@
 # Change 1..1 below to 1..last_test_to_print .
 # (It may become useful if the test is moved to ./t subdirectory.)
 
+use B q{svref_2object};
+
 my $has_data_dumper;
+
 BEGIN {
   $| = 1;
-  my $tests = 9;
+  my $tests = 12;
+  $tests += 2 if $] > 5.0219;
   eval q[use Data::Dumper];
   if (!$@) {
     $has_data_dumper = 1;
@@ -50,8 +54,20 @@
 
 package main;
                                                 
-sub ok     { print "ok $test\n"; $test++ }
-sub not_ok { print "not ok $test\n"; $test++ }
+sub ok     {
+  my ( $check, $msg ) = @_;
+
+  $msg = '' unless defined $msg;
+  if ( $check ) {
+    print "ok $test $msg\n";
+  } else {
+    print "not ok $test $msg\n";
+  }
+
+  $test++;
+
+  return;
+}
 
 $^W = 0;
 $test = 2;
@@ -59,37 +75,66 @@
 my $a = Test::Scalar->new(1.0);
 my $b = $a->clone(1);
 
-$$a == $$b ? ok : not_ok;
-$a != $b ? ok : not_ok;
+ok( $$a == $$b, '$$a == $$b' );
+ok( $a != $b, '$a != $b' );
+
+{
+  print "# using a reference on a string (CowREFCNT == 0).\n";
+
+  my $c = \"something";
+  my $d = Clone::clone($c, 2);
+
+  ok( $$c == $$d, 'test 2 scalar content' );
+  ok( $c != $d, 'SV are differents SVs' );
+}
+
+{
+  print "# using a reference on one SvPV (CowREFCNT > 0).\n";
+
+  my $str = "my string";
+  my $c = \$str;
+
+  my $d = Clone::clone($c, 2);
+
+  ok( $$c == $$d, 'test 2 scalar content' );
+  ok( $c != $d, 'SV are differents SVs' );
+
+
+  if ( $] > 5.0219 ) {
+    my $sv_c = svref_2object( $c );
+    my $sv_d = svref_2object( $d );
+
+    ok( $sv_c->FLAGS & B::SVf_IsCOW, 'COW flag set on c' );
+    ok( $sv_d->FLAGS & B::SVf_IsCOW, 'COW flag set on d' );
+  }
+}
 
-my $c = \"test 2 scalar";
-my $d = Clone::clone($c, 2);
 
-$$c == $$d ? ok : not_ok;
-$c != $d ? ok : not_ok;
+$$d .= 'abcd';
+ok( $$c ne $$d, 'only one scalar changed' );
 
 my $circ = undef;
 $circ = \$circ;
 $aref = clone($circ);
 if ($has_data_dumper) {
-  Dumper($circ) eq Dumper($aref) ? ok : not_ok;
+  ok( Dumper($circ) eq Dumper($aref), 'Dumper check' );
 }
 
 # the following used to produce a segfault, rt.cpan.org id=2264
 undef $a;
 $b = clone($a);
-$$a == $$b ? ok : not_ok;
+ok( $$a == $$b, 'int check' );
 
 # used to get a segfault cloning a ref to a qr data type.
 my $str = 'abcdefg';
 my $qr = qr/$str/;
 my $qc = clone( $qr );
-$qr eq $qc ? ok : not_ok;
-$str =~ /$qc/ ? ok : not_ok;
+ok( $qr eq $qc, 'string check' );
+ok( $str =~ /$qc/, 'regexp check' );
 
 # test for unicode support
 {
   my $a = \( chr(256) );
   my $b = clone( $a );
-  ord($$a) == ord($$b) ? ok : not_ok;
+  ok( ord($$a) == ord($$b) );
 }


Reply via email to