r39023 - in /trunk/libautodie-perl: ./ debian/ lib/ lib/autodie/ lib/autodie/exception/ t/ t/lib/Some/ t/lib/my/
angelabad-guest at users.alioth.debian.org
angelabad-guest at users.alioth.debian.org
Wed Jul 1 08:32:45 UTC 2009
Author: angelabad-guest
Date: Wed Jul 1 08:32:27 2009
New Revision: 39023
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=39023
Log:
New upstream release 2.03
Added:
trunk/libautodie-perl/t/blog_hints.t
- copied unchanged from r39020, branches/upstream/libautodie-perl/current/t/blog_hints.t
trunk/libautodie-perl/t/lib/Some/
- copied from r39020, branches/upstream/libautodie-perl/current/t/lib/Some/
trunk/libautodie-perl/t/lib/my/
- copied from r39020, branches/upstream/libautodie-perl/current/t/lib/my/
Modified:
trunk/libautodie-perl/Changes
trunk/libautodie-perl/MANIFEST
trunk/libautodie-perl/META.yml
trunk/libautodie-perl/debian/changelog
trunk/libautodie-perl/debian/control
trunk/libautodie-perl/debian/copyright
trunk/libautodie-perl/debian/rules
trunk/libautodie-perl/lib/Fatal.pm
trunk/libautodie-perl/lib/autodie.pm
trunk/libautodie-perl/lib/autodie/exception.pm
trunk/libautodie-perl/lib/autodie/exception/system.pm
trunk/libautodie-perl/lib/autodie/hints.pm
trunk/libautodie-perl/t/basic_exceptions.t
trunk/libautodie-perl/t/hints.t
Modified: trunk/libautodie-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libautodie-perl/Changes?rev=39023&op=diff
==============================================================================
--- trunk/libautodie-perl/Changes (original)
+++ trunk/libautodie-perl/Changes Wed Jul 1 08:32:27 2009
@@ -1,4 +1,23 @@
Revision history for autodie
+
+2.03 Wed Jul 1 15:39:16 AUSEST 2009
+
+ * BUGFIX: Stopped blog_hints.t from booching under Perl
+ 5.8.x. because parent.pm is not installed.
+
+2.02 Wed Jul 1 15:06:21 AUSEST 2009
+
+ * FEATURE: autodie::exception now supports ->context() to
+ discover the context of the failing subroutine, and
+ ->return() to get a list of what it returned.
+
+ * BUGFIX: ->function from autodie::exception now returns
+ the original name of the dying sub, rather than its imported
+ name. For example, 'File::Copy::copy' rather than 'main::copy'.
+ Core functions continue to always return 'CORE::whatever'.
+
+ * TEST: blog_hints.t tests new hinting features against
+ examples in my blog at http://pjf.id.au/blog/
2.01 Wed Jul 1 01:31:24 AUSEST 2009
Modified: trunk/libautodie-perl/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libautodie-perl/MANIFEST?rev=39023&op=diff
==============================================================================
--- trunk/libautodie-perl/MANIFEST (original)
+++ trunk/libautodie-perl/MANIFEST Wed Jul 1 08:32:27 2009
@@ -23,6 +23,7 @@
t/backcompat.t
t/basic_exceptions.t
t/binmode.t
+t/blog_hints.t
t/boilerplate.t
t/caller.t
t/context.t
@@ -61,9 +62,11 @@
t/lib/Hints_provider_isa.pm
t/lib/Hints_test.pm
t/lib/lethal.pm
+t/lib/my/autodie.pm
t/lib/OtherTypes.pm
t/lib/pujHa/ghach.pm
t/lib/pujHa/ghach/Dotlh.pm
+t/lib/Some/Module.pm
t/mkdir.t
t/open.t
t/pod-coverage.t
Modified: trunk/libautodie-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libautodie-perl/META.yml?rev=39023&op=diff
==============================================================================
--- trunk/libautodie-perl/META.yml (original)
+++ trunk/libautodie-perl/META.yml Wed Jul 1 08:32:27 2009
@@ -27,4 +27,4 @@
bugtracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=autodie
license: http://dev.perl.org/licenses/
repository: http://github.com/pfenwick/autodie/tree/master
-version: 2.01
+version: 2.03
Modified: trunk/libautodie-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libautodie-perl/debian/changelog?rev=39023&op=diff
==============================================================================
--- trunk/libautodie-perl/debian/changelog (original)
+++ trunk/libautodie-perl/debian/changelog Wed Jul 1 08:32:27 2009
@@ -1,3 +1,10 @@
+libautodie-perl (2.03-1) unstable; urgency=low
+
+ * New upstream release
+ * debian/rules: Move to mimalistic dh7 style
+
+ -- Angel Abad (Ikusnet SLL) <angel at grupoikusnet.com> Wed, 01 Jul 2009 10:24:00 +0200
+
libautodie-perl (2.01-1) unstable; urgency=low
* New upstream release
Modified: trunk/libautodie-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libautodie-perl/debian/control?rev=39023&op=diff
==============================================================================
--- trunk/libautodie-perl/debian/control (original)
+++ trunk/libautodie-perl/debian/control Wed Jul 1 08:32:27 2009
@@ -2,9 +2,10 @@
Section: perl
Priority: optional
Build-Depends: debhelper (>= 7)
-Build-Depends-Indep: perl (>= 5.8.0), libbsd-resource-perl,
- libipc-system-simple-perl, libtest-perl-critic-perl, libtest-pod-perl,
- libtest-pod-coverage-perl, libsub-identify-perl (>= 0.04)
+Build-Depends-Indep: libbsd-resource-perl, libipc-system-simple-perl,
+ libsub-identify-perl (>= 0.04), libtest-perl-critic-perl,
+ libtest-pod-coverage-perl, libtest-pod-perl, perl (>= 5.8.0),
+ perl-modules (>= 5.10.0)
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
Uploaders: Jeremiah C. Foster <jeremiah at jeremiahfoster.com>,
Rene Mayorga <rmayorga at debian.org.sv>, Jonathan Yu <frequency at cpan.org>,
@@ -16,9 +17,9 @@
Package: libautodie-perl
Architecture: all
-Depends: perl (>= 5.8.0), ${perl:Depends}, ${misc:Depends},
- libsub-identify-perl (>= 0.04)
-Suggests: libipc-system-simple-perl
+Depends: ${misc:Depends}, ${perl:Depends}, libsub-identify-perl (>= 0.04),
+ perl (>= 5.8.0)
+Recommends: libipc-system-simple-perl (>= 0.12)
Description: Perl pragma to make certain failures fatal
autodie is a Perl pragma that changes the behaviour of many built-in functions
so that exceptions are thrown on failure rather than simply a false value. It
Modified: trunk/libautodie-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libautodie-perl/debian/copyright?rev=39023&op=diff
==============================================================================
--- trunk/libautodie-perl/debian/copyright (original)
+++ trunk/libautodie-perl/debian/copyright Wed Jul 1 08:32:27 2009
@@ -19,19 +19,21 @@
License: Artistic | GPL-1+
Files: debian/*
-Copyright: 2009, Jonathan Yu <frequency at cpan.org>
- 2008, Jeremiah C. Foster <jeremiah at jeremiahfoster.com>
+Copyright: 2008, Jeremiah C. Foster <jeremiah at jeremiahfoster.com>
+ 2009, Angel Abad (Ikusnet SLL) <angel at grupoikusnet.com>
+ 2009, Jonathan Yu <frequency at cpan.org>
+ 2009, Rene Mayorga <rmayorga at debian.org.sv>
License: Artistic | GPL-1+
License: Artistic
This program is free software; you can redistribute it and/or modify
it under the terms of the Artistic License, which comes with Perl.
On Debian GNU/Linux systems, the complete text of the Artistic License
- can be found in /usr/share/common-licenses/Artistic
+ can be found in `/usr/share/common-licenses/Artistic'
License: GPL-1+
This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
+ it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
On Debian GNU/Linux systems, the complete text of the GNU General
Modified: trunk/libautodie-perl/debian/rules
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libautodie-perl/debian/rules?rev=39023&op=diff
==============================================================================
--- trunk/libautodie-perl/debian/rules (original)
+++ trunk/libautodie-perl/debian/rules Wed Jul 1 08:32:27 2009
@@ -1,23 +1,4 @@
#!/usr/bin/make -f
-build: build-stamp
-build-stamp:
- TEST_AUTHOR=1 dh build
- touch $@
-
-clean:
- dh $@
-
-install: install-stamp
-install-stamp: build-stamp
- dh install
- touch $@
-
-binary-arch:
-
-binary-indep: install
- dh $@
-
-binary: binary-arch binary-indep
-
-.PHONY: binary binary-arch binary-indep install clean build
+%:
+ TEST_AUTHOR=1 dh $@
Modified: trunk/libautodie-perl/lib/Fatal.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libautodie-perl/lib/Fatal.pm?rev=39023&op=diff
==============================================================================
--- trunk/libautodie-perl/lib/Fatal.pm (original)
+++ trunk/libautodie-perl/lib/Fatal.pm Wed Jul 1 08:32:27 2009
@@ -39,7 +39,7 @@
use constant MIN_IPC_SYS_SIMPLE_VER => 0.12;
# All the Fatal/autodie modules share the same version number.
-our $VERSION = '2.01';
+our $VERSION = '2.03';
our $Debug ||= 0;
@@ -96,6 +96,8 @@
':1.999_01' => [qw(:default)],
':2.00' => [qw(:default)],
':2.01' => [qw(:default)],
+ ':2.02' => [qw(:default)],
+ ':2.03' => [qw(:default)],
);
@@ -631,6 +633,13 @@
require autodie::hints;
$hints = autodie::hints->get_hints_for( $sref );
+
+ # We'll look up the sub's fullname. This means we
+ # get better reports of where it came from in our
+ # error messages, rather than what imported it.
+
+ $human_sub_name = autodie::hints->sub_fullname( $sref );
+
}
# Checks for special core subs.
@@ -686,6 +695,7 @@
die $class->throw(
function => q{$human_sub_name}, args => [ @argv ],
pragma => q{$class}, errno => \$!,
+ context => \$context, return => \$retval,
)
};
@@ -710,6 +720,8 @@
require Fcntl; # For Fcntl::LOCK_NB
return qq{
+
+ my \$context = wantarray() ? "list" : "scalar";
# Try to flock. If successful, return it immediately.
@@ -743,6 +755,8 @@
if (wantarray) {
my \@results = $call(@argv);
+ my \$retval = \\\@results;
+ my \$context = "list";
];
@@ -787,7 +801,8 @@
# at the result.
$code .= qq{
- my \$result = $call(@argv);
+ my \$retval = $call(@argv);
+ my \$context = "scalar";
};
if ( $hints and ( ref($hints->{scalar} ) || "" ) eq 'CODE' ) {
@@ -796,17 +811,17 @@
# works in 5.8.x, and always works in 5.10.1
return $code .= qq{
- if ( \$hints->{scalar}->(\$result) ) { $die };
- return \$result;
+ if ( \$hints->{scalar}->(\$retval) ) { $die };
+ return \$retval;
};
}
elsif (PERL510 and $hints) {
return $code . qq{
- if ( \$result ~~ \$hints->{scalar} ) { $die };
-
- return \$result;
+ if ( \$retval ~~ \$hints->{scalar} ) { $die };
+
+ return \$retval;
};
}
elsif ( $hints ) {
@@ -816,13 +831,13 @@
return $code .
( $use_defined_or ? qq{
- $die if not defined \$result;
-
- return \$result;
+ $die if not defined \$retval;
+
+ return \$retval;
} : qq{
- return \$result || $die;
+ return \$retval || $die;
} ) ;
Modified: trunk/libautodie-perl/lib/autodie.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libautodie-perl/lib/autodie.pm?rev=39023&op=diff
==============================================================================
--- trunk/libautodie-perl/lib/autodie.pm (original)
+++ trunk/libautodie-perl/lib/autodie.pm Wed Jul 1 08:32:27 2009
@@ -8,7 +8,7 @@
our $VERSION;
BEGIN {
- $VERSION = '2.01';
+ $VERSION = '2.03';
}
use constant ERROR_WRONG_FATAL => q{
Modified: trunk/libautodie-perl/lib/autodie/exception.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libautodie-perl/lib/autodie/exception.pm?rev=39023&op=diff
==============================================================================
--- trunk/libautodie-perl/lib/autodie/exception.pm (original)
+++ trunk/libautodie-perl/lib/autodie/exception.pm Wed Jul 1 08:32:27 2009
@@ -14,7 +14,7 @@
use if ($] >= 5.010), overload => '~~' => "matches";
-our $VERSION = '2.01';
+our $VERSION = '2.03';
my $PACKAGE = __PACKAGE__; # Useful to have a scalar for hash keys.
@@ -126,6 +126,31 @@
=cut
sub line { return $_[0]->{$PACKAGE}{line}; }
+
+=head3 context
+
+ my $context = $E->context;
+
+The context in which the subroutine was called. This can be
+'list', 'scalar', or undefined (unknown). It will never be 'void', as
+C<autodie> always captures the return value in one way or another.
+
+=cut
+
+sub context { return $_[0]->{$PACKAGE}{context} }
+
+=head3 return
+
+ my $return_value = $E->return;
+
+The value(s) returned by the failed subroutine. When the subroutine
+was called in a list context, this will always be a reference to an
+array containing the results. When the subroutine was called in
+a scalar context, this will be the actual scalar returned.
+
+=cut
+
+sub return { return $_[0]->{$PACKAGE}{return} }
=head3 errno
@@ -558,6 +583,8 @@
args => \@_,
function => "CORE::open",
errno => $!,
+ context => 'scalar',
+ return => undef,
);
@@ -658,6 +685,9 @@
$this->{$PACKAGE}{errno} = $args{errno} || 0;
+ $this->{$PACKAGE}{context} = $args{context};
+ $this->{$PACKAGE}{return} = $args{return};
+
$this->{$PACKAGE}{args} = $args{args} || [];
$this->{$PACKAGE}{function}= $args{function} or
croak("$class->new() called without function arg");
Modified: trunk/libautodie-perl/lib/autodie/exception/system.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libautodie-perl/lib/autodie/exception/system.pm?rev=39023&op=diff
==============================================================================
--- trunk/libautodie-perl/lib/autodie/exception/system.pm (original)
+++ trunk/libautodie-perl/lib/autodie/exception/system.pm Wed Jul 1 08:32:27 2009
@@ -5,7 +5,7 @@
use base 'autodie::exception';
use Carp qw(croak);
-our $VERSION = '2.01';
+our $VERSION = '2.03';
my $PACKAGE = __PACKAGE__;
Modified: trunk/libautodie-perl/lib/autodie/hints.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libautodie-perl/lib/autodie/hints.pm?rev=39023&op=diff
==============================================================================
--- trunk/libautodie-perl/lib/autodie/hints.pm (original)
+++ trunk/libautodie-perl/lib/autodie/hints.pm Wed Jul 1 08:32:27 2009
@@ -5,7 +5,7 @@
use constant PERL58 => ( $] < 5.009 );
-our $VERSION = '2.01';
+our $VERSION = '2.03';
=head1 NAME
Modified: trunk/libautodie-perl/t/basic_exceptions.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libautodie-perl/t/basic_exceptions.t?rev=39023&op=diff
==============================================================================
--- trunk/libautodie-perl/t/basic_exceptions.t (original)
+++ trunk/libautodie-perl/t/basic_exceptions.t Wed Jul 1 08:32:27 2009
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
use strict;
-use Test::More tests => 17;
+use Test::More tests => 19;
use constant NO_SUCH_FILE => "this_file_had_better_not_exist";
@@ -28,6 +28,8 @@
is($@->args->[2], NO_SUCH_FILE, 'Correct filename arg');
ok($@->matches('open'), 'Looks like an error from open');
ok($@->matches(':io'), 'Looks like an error from :io');
+is($@->context, 'scalar', 'Open called in scalar/void context');
+is($@->return,undef,'Open should return undef on failure');
# Testing of caller info with a real subroutine.
Modified: trunk/libautodie-perl/t/hints.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libautodie-perl/t/hints.t?rev=39023&op=diff
==============================================================================
--- trunk/libautodie-perl/t/hints.t (original)
+++ trunk/libautodie-perl/t/hints.t Wed Jul 1 08:32:27 2009
@@ -60,6 +60,10 @@
isnt("$@", "", "Copying in scalar context should throw an error.");
isa_ok($@, "autodie::exception");
+is($@->function, "File::Copy::copy", "Function should be original name");
+is($@->return, 0, "File::Copy returns zero on failure");
+is($@->context, "scalar", "File::Copy called in scalar context");
+
# List context test.
eval {
@@ -70,6 +74,10 @@
isnt("$@", "", "Copying in list context should throw an error.");
isa_ok($@, "autodie::exception");
+
+is($@->function, "File::Copy::copy", "Function should be original name");
+is_deeply($@->return, [0], "File::Copy returns zero on failure");
+is($@->context, "list", "File::Copy called in list context");
# Tests on loaded funcs.
More information about the Pkg-perl-cvs-commits
mailing list