Hello community,

here is the log from the commit of package perl-Struct-Dumb for 
openSUSE:Factory checked in at 2015-12-17 15:54:57
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Struct-Dumb (Old)
 and      /work/SRC/openSUSE:Factory/.perl-Struct-Dumb.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-Struct-Dumb"

Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Struct-Dumb/perl-Struct-Dumb.changes        
2015-10-14 16:45:20.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.perl-Struct-Dumb.new/perl-Struct-Dumb.changes   
2015-12-17 15:55:01.000000000 +0100
@@ -1,0 +2,10 @@
+Wed Dec 16 10:07:04 UTC 2015 - co...@suse.com
+
+- updated to 0.08
+   see /usr/share/doc/packages/perl-Struct-Dumb/Changes
+
+  0.08    2015/12/15 17:45:46
+          [CHANGES]
+           * Support perl 5.8.x (which lacks overloading.pm)
+
+-------------------------------------------------------------------

Old:
----
  Struct-Dumb-0.07.tar.gz

New:
----
  Struct-Dumb-0.08.tar.gz

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

Other differences:
------------------
++++++ perl-Struct-Dumb.spec ++++++
--- /var/tmp/diff_new_pack.fRefKF/_old  2015-12-17 15:55:02.000000000 +0100
+++ /var/tmp/diff_new_pack.fRefKF/_new  2015-12-17 15:55:02.000000000 +0100
@@ -17,7 +17,7 @@
 
 
 Name:           perl-Struct-Dumb
-Version:        0.07
+Version:        0.08
 Release:        0
 %define cpan_name Struct-Dumb
 Summary:        Make Simple Lightweight Record-Like Structures
@@ -53,8 +53,10 @@
 tempted to abuse a hash, complete with the risk of typoing key names. The
 constructor will 'croak' if passed the wrong number of arguments, as will
 attempts to refer to fields that don't exist. Accessor-mutators will
-'croak' if invoked with extra arguments; a likely bug in case of mutations,
-or attempts to invoke a stored 'CODE' reference.
+'croak' if invoked with arguments. (This helps detect likely bugs such as
+accidentally passing in the new value as an argument, or attempting to
+invoke a stored 'CODE' reference by passing argument values directly to the
+accessor.)
 
  $ perl -E 'use Struct::Dumb; struct Point => [qw( x y )]; Point(30)'
  usage: main::Point($x, $y) at -e line 1
@@ -65,6 +67,11 @@
  $ perl -E 'use Struct::Dumb; struct Point => [qw( x y )]; Point(1,2)->x(3)'
  main::Point->x invoked with arguments at -e line 1.
 
+Objects in this class are (currently) backed by an ARRAY reference store,
+though this is an internal implementation detail and should not be relied
+on by using code. Attempting to dereference the object as an ARRAY will
+throw an exception.
+
 %prep
 %setup -q -n %{cpan_name}-%{version}
 

++++++ Struct-Dumb-0.07.tar.gz -> Struct-Dumb-0.08.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Struct-Dumb-0.07/Changes new/Struct-Dumb-0.08/Changes
--- old/Struct-Dumb-0.07/Changes        2015-10-11 13:39:45.000000000 +0200
+++ new/Struct-Dumb-0.08/Changes        2015-12-15 18:51:16.000000000 +0100
@@ -1,5 +1,9 @@
 Revision history for Struct-Dumb
 
+0.08    2015/12/15 17:45:46
+        [CHANGES]
+         * Support perl 5.8.x (which lacks overloading.pm)
+
 0.07    2015/10/11 12:37:51
         [BUGFIXES]
          * Provide the other conversion overload operations and allow fallback
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Struct-Dumb-0.07/META.json 
new/Struct-Dumb-0.08/META.json
--- old/Struct-Dumb-0.07/META.json      2015-10-11 13:39:45.000000000 +0200
+++ new/Struct-Dumb-0.08/META.json      2015-12-15 18:51:16.000000000 +0100
@@ -24,7 +24,7 @@
    "provides" : {
       "Struct::Dumb" : {
          "file" : "lib/Struct/Dumb.pm",
-         "version" : "0.07"
+         "version" : "0.08"
       }
    },
    "release_status" : "stable",
@@ -33,5 +33,5 @@
          "http://dev.perl.org/licenses/";
       ]
    },
-   "version" : "0.07"
+   "version" : "0.08"
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Struct-Dumb-0.07/META.yml 
new/Struct-Dumb-0.08/META.yml
--- old/Struct-Dumb-0.07/META.yml       2015-10-11 13:39:45.000000000 +0200
+++ new/Struct-Dumb-0.08/META.yml       2015-12-15 18:51:16.000000000 +0100
@@ -15,7 +15,7 @@
 provides:
   Struct::Dumb:
     file: lib/Struct/Dumb.pm
-    version: '0.07'
+    version: '0.08'
 resources:
   license: http://dev.perl.org/licenses/
-version: '0.07'
+version: '0.08'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Struct-Dumb-0.07/README new/Struct-Dumb-0.08/README
--- old/Struct-Dumb-0.07/README 2015-10-11 13:39:45.000000000 +0200
+++ new/Struct-Dumb-0.08/README 2015-12-15 18:51:16.000000000 +0100
@@ -55,8 +55,10 @@
     be tempted to abuse a hash, complete with the risk of typoing key names.
     The constructor will `croak' if passed the wrong number of arguments, as
     will attempts to refer to fields that don't exist. Accessor-mutators
-    will `croak' if invoked with extra arguments; a likely bug in case of
-    mutations, or attempts to invoke a stored `CODE' reference.
+    will `croak' if invoked with arguments. (This helps detect likely bugs
+    such as accidentally passing in the new value as an argument, or
+    attempting to invoke a stored `CODE' reference by passing argument
+    values directly to the accessor.)
 
      $ perl -E 'use Struct::Dumb; struct Point => [qw( x y )]; Point(30)'
      usage: main::Point($x, $y) at -e line 1
@@ -67,6 +69,11 @@
      $ perl -E 'use Struct::Dumb; struct Point => [qw( x y )]; 
Point(1,2)->x(3)'
      main::Point->x invoked with arguments at -e line 1.
 
+    Objects in this class are (currently) backed by an ARRAY reference
+    store, though this is an internal implementation detail and should not
+    be relied on by using code. Attempting to dereference the object as an
+    ARRAY will throw an exception.
+
   CONSTRUCTOR FORMS
     The `struct' and `readonly_struct' declarations create two different
     kinds of constructor function, depending on the setting of the
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Struct-Dumb-0.07/lib/Struct/Dumb.pm 
new/Struct-Dumb-0.08/lib/Struct/Dumb.pm
--- old/Struct-Dumb-0.07/lib/Struct/Dumb.pm     2015-10-11 13:39:45.000000000 
+0200
+++ new/Struct-Dumb-0.08/lib/Struct/Dumb.pm     2015-12-15 18:51:16.000000000 
+0100
@@ -8,12 +8,16 @@
 use strict;
 use warnings;
 
-our $VERSION = '0.07';
+our $VERSION = '0.08';
 
 use Carp;
 
 use Scalar::Util qw( refaddr );
 
+# 'overloading.pm' was only added in 5.10
+# Before that we can't easily implement forbidding of @{} overload, so lets not
+use constant HAVE_OVERLOADING => eval { require overloading };
+
 =head1 NAME
 
 C<Struct::Dumb> - make simple lightweight record-like structures
@@ -74,8 +78,9 @@
 tempted to abuse a hash, complete with the risk of typoing key names. The
 constructor will C<croak> if passed the wrong number of arguments, as will
 attempts to refer to fields that don't exist. Accessor-mutators will C<croak>
-if invoked with extra arguments; a likely bug in case of mutations, or
-attempts to invoke a stored C<CODE> reference.
+if invoked with arguments. (This helps detect likely bugs such as accidentally
+passing in the new value as an argument, or attempting to invoke a stored
+C<CODE> reference by passing argument values directly to the accessor.)
 
  $ perl -E 'use Struct::Dumb; struct Point => [qw( x y )]; Point(30)'
  usage: main::Point($x, $y) at -e line 1
@@ -86,6 +91,11 @@
  $ perl -E 'use Struct::Dumb; struct Point => [qw( x y )]; Point(1,2)->x(3)'
  main::Point->x invoked with arguments at -e line 1.
 
+Objects in this class are (currently) backed by an ARRAY reference store,
+though this is an internal implementation detail and should not be relied on
+by using code. Attempting to dereference the object as an ARRAY will throw an
+exception.
+
 =head2 CONSTRUCTOR FORMS
 
 The C<struct> and C<readonly_struct> declarations create two different kinds
@@ -161,7 +171,10 @@
       my $idx = $_;
       my $field = $fields->[$idx];
 
-      no overloading;
+      BEGIN {
+         overloading->unimport if HAVE_OVERLOADING;
+      }
+
       $subs{$field} = $lvalue
          ? sub :lvalue { @_ > 1 and croak "$pkg->$field invoked with 
arguments";
                          shift->[$idx] }
@@ -204,12 +217,13 @@
    *{"${caller}::$name"} = $constructor;
 
    if( my $predicate = $opts{predicate} ) {
-      *{"${caller}::$predicate"} = sub { ( ref($_[0]) // "" ) eq $pkg };
+      *{"${caller}::$predicate"} = sub { ( ref($_[0]) || "" ) eq $pkg };
    }
 
    require overload;
    $pkg->overload::OVERLOAD(
-      '@{}'  => sub { croak "Cannot use $pkg as an ARRAY reference" },
+      '@{}'  => sub { return $_[0] if !HAVE_OVERLOADING and caller eq 
__PACKAGE__;
+                      croak "Cannot use $pkg as an ARRAY reference" },
       '0+'   => sub { refaddr $_[0] },
       '""'   => sub { sprintf "%s=Struct::Dumb(%#x)", $pkg, refaddr $_[0] },
       'bool' => sub { 1 },


Reply via email to