r26319 - in /branches/upstream/libdevel-stacktrace-perl/current: Build.PL Changes META.yml Makefile.PL SIGNATURE lib/Devel/StackTrace.pm t/01-basic.t

rmayorga-guest at users.alioth.debian.org rmayorga-guest at users.alioth.debian.org
Tue Oct 28 23:31:48 UTC 2008


Author: rmayorga-guest
Date: Tue Oct 28 23:31:46 2008
New Revision: 26319

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=26319
Log:
[svn-upgrade] Integrating new upstream version, libdevel-stacktrace-perl (1.2000)

Modified:
    branches/upstream/libdevel-stacktrace-perl/current/Build.PL
    branches/upstream/libdevel-stacktrace-perl/current/Changes
    branches/upstream/libdevel-stacktrace-perl/current/META.yml
    branches/upstream/libdevel-stacktrace-perl/current/Makefile.PL
    branches/upstream/libdevel-stacktrace-perl/current/SIGNATURE
    branches/upstream/libdevel-stacktrace-perl/current/lib/Devel/StackTrace.pm
    branches/upstream/libdevel-stacktrace-perl/current/t/01-basic.t

Modified: branches/upstream/libdevel-stacktrace-perl/current/Build.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-stacktrace-perl/current/Build.PL?rev=26319&op=diff
==============================================================================
--- branches/upstream/libdevel-stacktrace-perl/current/Build.PL (original)
+++ branches/upstream/libdevel-stacktrace-perl/current/Build.PL Tue Oct 28 23:31:46 2008
@@ -8,9 +8,10 @@
 my $build =
     Module::Build->new( module_name => 'Devel::StackTrace',
                         license     => 'perl',
-                        requires    => { 'Test::More' => '0.46',
-                                         'File::Spec' => 0,
-                                         'perl'       => 5.006,
+                        requires    => { 'File::Spec'   => '0',
+                                         'Scalar::Util' => '0',
+                                         'Test::More'   => '0.46',
+                                         'perl'         => '5.006',
                                        },
                         sign        => 1,
                         create_makefile_pl => 'traditional',

Modified: branches/upstream/libdevel-stacktrace-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-stacktrace-perl/current/Changes?rev=26319&op=diff
==============================================================================
--- branches/upstream/libdevel-stacktrace-perl/current/Changes (original)
+++ branches/upstream/libdevel-stacktrace-perl/current/Changes Tue Oct 28 23:31:46 2008
@@ -1,3 +1,13 @@
+1.20  Oct 25, 2008
+
+- The change in 1.15 to object creation broke the no_refs feature,
+  causing references to be stored until the trace's frame objects were
+  created.
+
+* Exception::Class objects are always stringified by calling
+  overload::StrVal().
+
+
 1.1902  Jul 16, 2008
 
 - This release just contains another test fix.

Modified: branches/upstream/libdevel-stacktrace-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-stacktrace-perl/current/META.yml?rev=26319&op=diff
==============================================================================
--- branches/upstream/libdevel-stacktrace-perl/current/META.yml (original)
+++ branches/upstream/libdevel-stacktrace-perl/current/META.yml Tue Oct 28 23:31:46 2008
@@ -1,6 +1,6 @@
 ---
 name: Devel-StackTrace
-version: 1.1902
+version: 1.20
 author:
   - 'Dave Rolsky, <autarch at urth.org>'
 abstract: Stack trace and stack trace frame objects
@@ -9,13 +9,14 @@
   license: http://dev.perl.org/licenses/
 requires:
   File::Spec: 0
+  Scalar::Util: 0
   Test::More: 0.46
   perl: 5.006
 provides:
   Devel::StackTrace:
     file: lib/Devel/StackTrace.pm
-    version: 1.1902
-generated_by: Module::Build version 0.2808
+    version: 1.20
+generated_by: Module::Build version 0.3
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.2.html
   version: 1.2

Modified: branches/upstream/libdevel-stacktrace-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-stacktrace-perl/current/Makefile.PL?rev=26319&op=diff
==============================================================================
--- branches/upstream/libdevel-stacktrace-perl/current/Makefile.PL (original)
+++ branches/upstream/libdevel-stacktrace-perl/current/Makefile.PL Tue Oct 28 23:31:46 2008
@@ -1,4 +1,5 @@
-# Note: this file was auto-generated by Module::Build::Compat version 0.03
+# Note: this file was auto-generated by Module::Build::Compat version 0.30
+require 5.006;
 use ExtUtils::MakeMaker;
 WriteMakefile
 (
@@ -6,6 +7,7 @@
           'VERSION_FROM' => 'lib/Devel/StackTrace.pm',
           'PREREQ_PM' => {
                            'File::Spec' => '0',
+                           'Scalar::Util' => '0',
                            'Test::More' => '0.46'
                          },
           'INSTALLDIRS' => 'site',

Modified: branches/upstream/libdevel-stacktrace-perl/current/SIGNATURE
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-stacktrace-perl/current/SIGNATURE?rev=26319&op=diff
==============================================================================
--- branches/upstream/libdevel-stacktrace-perl/current/SIGNATURE (original)
+++ branches/upstream/libdevel-stacktrace-perl/current/SIGNATURE Tue Oct 28 23:31:46 2008
@@ -15,15 +15,15 @@
 Hash: SHA1
 
 SHA1 7afddfc9acf24c266120ef5c2f7bd386d2d3901d .shipit
-SHA1 3d845cfeefa52ba71f90d8e43e7f17214c0365b8 Build.PL
-SHA1 c445e1b99f98b880aa20fdc891d59128925d77d7 Changes
+SHA1 e35fb27b937280dc6e1b2f441a59e47b68faa1d1 Build.PL
+SHA1 a454d582e94ca46316c818abfa36dcea056689f0 Changes
 SHA1 f235ba4160673bcb7c9d58c2f09dbc7fc0efadea LICENSE
 SHA1 9ed43409974a8b931e0e34af209d4f99ccc68d50 MANIFEST
-SHA1 569af5aa90ed3899d145f00abcca1cc0cbf79c08 META.yml
-SHA1 c3d9c0c03faad299fd07bf46c48f7ad0edc204a1 Makefile.PL
+SHA1 283f44833e79b89be9cdd51b9de3264d92de2822 META.yml
+SHA1 b485f5171773c668c0c0604ebf436019f9b3412e Makefile.PL
 SHA1 2c9447514240fab2c68851da0e4f3dbbb2157767 README
-SHA1 263b4336563e7b017ac42f466c589f3e10e53c66 lib/Devel/StackTrace.pm
-SHA1 a2379209b184d257b818ea03c2952e836a64c8f2 t/01-basic.t
+SHA1 c71c041da6c6c63e821eed2399c1e0b64284c784 lib/Devel/StackTrace.pm
+SHA1 4a59de3a5627f92d42f794edc9f00a37911b3e73 t/01-basic.t
 SHA1 21a1538da8dbde54af7a1708fa2470dd74fe67fc t/02-bad-utf8.t
 SHA1 9ade2293d6e5ea77d94532132c89cd205ea85ed7 t/kwalitee.t
 SHA1 28a931f3b0c075d8d6c4ce47d5e89c3fdb19ed0f t/pod-coverage.t
@@ -31,7 +31,7 @@
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.6 (GNU/Linux)
 
-iD8DBQFIffVr3Or3ZzQuifMRAlZ7AKCGL9lujqJNySvc6x0Et9O5JQkR9QCfaO25
-pbLrUnV6b0xqqR+xW4r1TTo=
-=1UDd
+iD8DBQFJA8sa3Or3ZzQuifMRAk2uAJ0dELxZwEra89LrD/rvL7zqh2WJpgCfTI9l
++ZZvLPKf52IJkyOVjsVMKKw=
+=4/ql
 -----END PGP SIGNATURE-----

Modified: branches/upstream/libdevel-stacktrace-perl/current/lib/Devel/StackTrace.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-stacktrace-perl/current/lib/Devel/StackTrace.pm?rev=26319&op=diff
==============================================================================
--- branches/upstream/libdevel-stacktrace-perl/current/lib/Devel/StackTrace.pm (original)
+++ branches/upstream/libdevel-stacktrace-perl/current/lib/Devel/StackTrace.pm Tue Oct 28 23:31:46 2008
@@ -6,12 +6,13 @@
 use warnings;
 
 use File::Spec;
+use Scalar::Util qw( blessed );
 
 use overload
     '""' => \&as_string,
     fallback => 1;
 
-our $VERSION = '1.1902';
+our $VERSION = '1.20';
 
 
 sub new
@@ -46,6 +47,11 @@
             do { package DB; @DB::args = (); caller($x++) } )
     {
         my @a = @DB::args;
+
+        if ( $self->{no_refs} ) {
+            @a = map { ref $_ ? $self->_ref_to_string($_) : $_ } @a;
+        }
+
         push @{ $self->{raw} },
             { caller => \@c,
               args   => \@a,
@@ -53,6 +59,42 @@
     }
 }
 
+sub _ref_to_string
+{
+    my $self = shift;
+    my $ref  = shift;
+
+    return overload::StrVal($ref)
+        if blessed $ref && $ref->isa('Exception::Class::Base');
+
+    return overload::StrVal($ref) unless $self->{respect_overload};
+    # force stringification and let overloading do its thing
+    return $ref . '';
+}
+
+sub _ecb_hack
+{
+    my $self = shift;
+    my $ref  = shift;
+
+    # This avoids a loop between Exception::Class::Base and this module
+    if ( $ref->can('show_trace') )
+    {
+        my $t = $ref->show_trace;
+        $ref->show_trace(0);
+        my $s = "$ref";
+        $ref->show_trace($t);
+
+        return $s;
+    }
+    else
+    {
+        # hack but should work with older
+        # versions of E::C::B
+        return $ref->{message};
+    }
+}
+
 sub _make_frames
 {
     my $self = shift;
@@ -96,48 +138,11 @@
 
     if ( $self->{no_refs} )
     {
-        for ( grep { ref } @{$args} )
-        {
-            # I can't remember what this is about but I think
-            # it must be to avoid a loop between between
-            # Exception::Class and this module.
-            if ( UNIVERSAL::isa( $_, 'Exception::Class::Base' ) )
-            {
-                $_ = do { if ( $_->can('show_trace') )
-                          {
-                              my $t = $_->show_trace;
-                              $_->show_trace(0);
-                              my $s = "$_";
-                              $_->show_trace($t);
-                              $s;
-                          }
-                          else
-                          {
-                              # hack but should work with older
-                              # versions of E::C::B
-                              $_->{message};
-                          }
-                        };
-            }
-            else
-            {
-                $_ = $self->_ref_as_string($_);
-            }
-        }
     }
 
     push @{ $self->{frames} },
         Devel::StackTraceFrame->new( $c, $args,
                                      $self->{respect_overload}, $self->{max_arg_length} );
-}
-
-sub _ref_as_string
-{
-    my $self = shift;
-
-    return overload::StrVal($_[0]) unless $self->{respect_overload};
-    # force stringification
-    return $_[0] . '';
 }
 
 sub next_frame
@@ -329,7 +334,7 @@
                 $_ = "undef", next unless defined $_;
 
                 # hack!
-                $_ = $self->Devel::StackTrace::_ref_as_string($_)
+                $_ = $self->Devel::StackTrace::_ref_to_string($_)
                     if ref $_;
 
                 eval

Modified: branches/upstream/libdevel-stacktrace-perl/current/t/01-basic.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libdevel-stacktrace-perl/current/t/01-basic.t?rev=26319&op=diff
==============================================================================
--- branches/upstream/libdevel-stacktrace-perl/current/t/01-basic.t (original)
+++ branches/upstream/libdevel-stacktrace-perl/current/t/01-basic.t Tue Oct 28 23:31:46 2008
@@ -5,7 +5,7 @@
 
 BEGIN
 {
-    my $tests = 35;
+    my $tests = 37;
     eval { require Exception::Class };
     $tests++ if ! $@ && $Exception::Class::VERSION >= 1.09;
 
@@ -279,6 +279,18 @@
     is( $frame->filename, 'foo/bar/baz.pm', 'filename is canonicalized' );
 }
 
+{
+    my $obj = RefTest4->new();
+
+    my $trace = $obj->{trace};
+
+    ok( ( ! grep { ref $_ } map { @{ $_->{args} } } @{ $trace->{raw} } ),
+        'raw data does not contain any references when no_refs is true' );
+
+    is( $trace->{raw}[1]{args}[1], 'not a ref',
+        'non-refs are preserved properly in raw data as well' );
+}
+
 # This means I can move these lines down without constantly fiddling
 # with the checks for line numbers in the tests.
 
@@ -386,3 +398,19 @@
 {
     Devel::StackTrace->new( no_object_refs => 1 );
 }
+
+package RefTest4;
+
+sub new
+{
+    my $self = bless {}, shift;
+
+    $self->{trace} = trace( $self, 'not a ref' );
+
+    return $self;
+}
+
+sub trace
+{
+    Devel::StackTrace->new( no_refs => 1 );
+}




More information about the Pkg-perl-cvs-commits mailing list