From: rkinyon Date: Fri, 21 Sep 2007 01:13:08 +0000 (+0000) Subject: r6122@000-443-371 (orig r9951): rkinyon | 2007-09-19 22:33:23 -0400 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=26f890860c82c70e01205036d69d6a8cc9530e90;p=dbsrgits%2FDBM-Deep.git r6122@000-443-371 (orig r9951): rkinyon | 2007-09-19 22:33:23 -0400 Extended _throw_error per brian d foy's suggestion r6126@000-443-371 (orig r9959): rkinyon | 2007-09-20 21:12:41 -0400 Incremented version number, added diag for 5.9.5 failures in t/17_import.t, and updated Changes file --- diff --git a/Changes b/Changes index 850dc44..7211f45 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,16 @@ Revision history for DBM::Deep. +1.0002 Sep 20 22:00:00 2007 EDT + - (This version is compatible with 1.0001) + - Expanded _throw_error() so that it provides better information. + (Thanks brian d foy!) + - Fixed how shift, unshift, and splice work when there are references + being moved. It now no longer dies. + - Added diag in t/17_import.t to note that the failing tests on blead + are due to Clone being broken, not DBM::Deep. The tests will still + fail because I don't want users to install something that's broken + and deal with those bug reports. + 1.0001 Mar 12 16:15:00 2007 EDT - (This version is compatible with 1.0000) - Added a missing dependency on IO::Scalar (RT #25387) diff --git a/lib/DBM/Deep.pm b/lib/DBM/Deep.pm index 6a005a0..f5ecd68 100644 --- a/lib/DBM/Deep.pm +++ b/lib/DBM/Deep.pm @@ -5,7 +5,7 @@ use 5.006_000; use strict; use warnings; -our $VERSION = q(1.0001); +our $VERSION = q(1.0002); use Fcntl qw( :flock ); @@ -390,6 +390,14 @@ sub _fh { sub _throw_error { die "DBM::Deep: $_[1]\n"; + my $n = 0; + while( 1 ) { + my @caller = caller( ++$n ); + next if $caller[0] =~ m/^DBM::Deep/; + + die "DBM::Deep: $_[1] at $0 line $caller[2]\n"; + last; + } } sub STORE { diff --git a/lib/DBM/Deep/Array.pm b/lib/DBM/Deep/Array.pm index 9816303..db84214 100644 --- a/lib/DBM/Deep/Array.pm +++ b/lib/DBM/Deep/Array.pm @@ -5,7 +5,7 @@ use 5.006_000; use strict; use warnings; -our $VERSION = q(1.0001); +our $VERSION = q(1.0002); # This is to allow DBM::Deep::Array to handle negative indices on # its own. Otherwise, Perl would intercept the call to negative @@ -251,15 +251,17 @@ sub PUSH { return $length; } +# XXX This really needs to be something more direct within the file, not a +# fetch and re-store. -RobK, 2007-09-20 sub _move_value { my $self = shift; my ($old_key, $new_key) = @_; my $val = $self->FETCH( $old_key ); - if ( eval { $val->isa( 'DBM::Deep::Hash' ) } ) { + if ( eval { local $SIG{'__DIE__'}; $val->isa( 'DBM::Deep::Hash' ) } ) { $self->STORE( $new_key, { %$val } ); } - elsif ( eval { $val->isa( 'DBM::Deep::Array' ) } ) { + elsif ( eval { local $SIG{'__DIE__'}; $val->isa( 'DBM::Deep::Array' ) } ) { $self->STORE( $new_key, [ @$val ] ); } else { diff --git a/lib/DBM/Deep/Engine.pm b/lib/DBM/Deep/Engine.pm index 2603045..ea8b794 100644 --- a/lib/DBM/Deep/Engine.pm +++ b/lib/DBM/Deep/Engine.pm @@ -5,7 +5,7 @@ use 5.006_000; use strict; use warnings; -our $VERSION = q(1.0001); +our $VERSION = q(1.0002); use Scalar::Util (); diff --git a/lib/DBM/Deep/File.pm b/lib/DBM/Deep/File.pm index 91c28ba..3f8511e 100644 --- a/lib/DBM/Deep/File.pm +++ b/lib/DBM/Deep/File.pm @@ -5,7 +5,7 @@ use 5.006_000; use strict; use warnings; -our $VERSION = q(1.0001); +our $VERSION = q(1.0002); use Fcntl qw( :DEFAULT :flock :seek ); diff --git a/lib/DBM/Deep/Hash.pm b/lib/DBM/Deep/Hash.pm index 19035df..3602a90 100644 --- a/lib/DBM/Deep/Hash.pm +++ b/lib/DBM/Deep/Hash.pm @@ -5,7 +5,7 @@ use 5.006_000; use strict; use warnings; -our $VERSION = q(1.0001); +our $VERSION = q(1.0002); use base 'DBM::Deep'; diff --git a/t/17_import.t b/t/17_import.t index 7792b6d..b4ff262 100644 --- a/t/17_import.t +++ b/t/17_import.t @@ -56,6 +56,9 @@ use_ok( 'DBM::Deep' ); } { + diag "\nThere seems to be a bug in Clone on Perl 5.9+ that is causing\nthese tests to fail." + if $] >= 5.009; + my ($fh, $filename) = new_fh(); my $db = DBM::Deep->new({ file => $filename,