From 6bea49c6a089e56e8992e4a8b4d828c1deacbb10 Mon Sep 17 00:00:00 2001 From: espie Date: Fri, 8 Mar 2013 12:12:03 +0000 Subject: [PATCH] perl debug tool: when your program dies/warns, always show carp longmess okay sthen@ --- devel/p5-Carp-Always/Makefile | 15 ++++++++++++ devel/p5-Carp-Always/distinfo | 2 ++ .../patches/patch-lib_Carp_Always_pm | 24 +++++++++++++++++++ devel/p5-Carp-Always/pkg/DESCR | 5 ++++ devel/p5-Carp-Always/pkg/PLIST | 4 ++++ 5 files changed, 50 insertions(+) create mode 100644 devel/p5-Carp-Always/Makefile create mode 100644 devel/p5-Carp-Always/distinfo create mode 100644 devel/p5-Carp-Always/patches/patch-lib_Carp_Always_pm create mode 100644 devel/p5-Carp-Always/pkg/DESCR create mode 100644 devel/p5-Carp-Always/pkg/PLIST diff --git a/devel/p5-Carp-Always/Makefile b/devel/p5-Carp-Always/Makefile new file mode 100644 index 00000000000..6c36e285297 --- /dev/null +++ b/devel/p5-Carp-Always/Makefile @@ -0,0 +1,15 @@ +# $OpenBSD: Makefile,v 1.1.1.1 2013/03/08 12:12:03 espie Exp $ + +COMMENT = turn every die/warn into carp verbose messages + +DISTNAME = Carp-Always-0.12 +CATEGORIES = devel + +MODULES = cpan + +# perl +PERMIT_PACKAGE_CDROM = Yes +PERMIT_PACKAGE_FTP = Yes +PERMIT_DISTFILES_FTP = Yes + +.include diff --git a/devel/p5-Carp-Always/distinfo b/devel/p5-Carp-Always/distinfo new file mode 100644 index 00000000000..04e1df4ddae --- /dev/null +++ b/devel/p5-Carp-Always/distinfo @@ -0,0 +1,2 @@ +SHA256 (Carp-Always-0.12.tar.gz) = t+BRstcBMmTUumDK2f953pypkRT2TantEUeFePXWGPo= +SIZE (Carp-Always-0.12.tar.gz) = 5418 diff --git a/devel/p5-Carp-Always/patches/patch-lib_Carp_Always_pm b/devel/p5-Carp-Always/patches/patch-lib_Carp_Always_pm new file mode 100644 index 00000000000..4f2970446e1 --- /dev/null +++ b/devel/p5-Carp-Always/patches/patch-lib_Carp_Always_pm @@ -0,0 +1,24 @@ +$OpenBSD: patch-lib_Carp_Always_pm,v 1.1.1.1 2013/03/08 12:12:03 espie Exp $ +--- lib/Carp/Always.pm.orig Mon Feb 18 11:24:02 2013 ++++ lib/Carp/Always.pm Mon Feb 18 11:25:13 2013 +@@ -9,6 +9,8 @@ our $VERSION = '0.12'; + + use Carp qw(verbose); # makes carp() cluck and croak() confess + ++my %OLD_SIG; ++ + sub _warn { + if ($_[-1] =~ /\n$/s) { + my $arg = pop @_; +@@ -25,10 +27,9 @@ sub _die { + $arg =~ s/(.*)( at .*? line .*?\n$)/$1/s; + push @_, $arg; + } ++ $SIG{__DIE__} = $OLD_SIG{__DIE__}; + die &Carp::longmess; + } +- +-my %OLD_SIG; + + BEGIN { + @OLD_SIG{qw(__DIE__ __WARN__)} = @SIG{qw(__DIE__ __WARN__)}; diff --git a/devel/p5-Carp-Always/pkg/DESCR b/devel/p5-Carp-Always/pkg/DESCR new file mode 100644 index 00000000000..8f51c53bc07 --- /dev/null +++ b/devel/p5-Carp-Always/pkg/DESCR @@ -0,0 +1,5 @@ +make every warn() and die() complains loudly in the calling package and +elsewhere. More often used on the command line: + + perl -MCarp::Always script.pl + diff --git a/devel/p5-Carp-Always/pkg/PLIST b/devel/p5-Carp-Always/pkg/PLIST new file mode 100644 index 00000000000..55f4d4444d8 --- /dev/null +++ b/devel/p5-Carp-Always/pkg/PLIST @@ -0,0 +1,4 @@ +@comment $OpenBSD: PLIST,v 1.1.1.1 2013/03/08 12:12:03 espie Exp $ +${P5SITE}/Carp/ +${P5SITE}/Carp/Always.pm +@man man/man3p/Carp::Always.3p