From 6923ce6e93de624ede2e48ce557b557f4af261f0 Mon Sep 17 00:00:00 2001 From: Yen-Ming Lee Date: Thu, 10 Feb 2005 06:08:53 +0000 Subject: [PATCH] Sub::Override allows the programmer to simply name the sub to replace and to supply a sub to replace it with. WWW: http://search.cpan.org/dist/Sub-Override/ PR: 75804 Submitted by: Lars Eggert --- devel/Makefile | 1 + devel/p5-Sub-Override/Makefile | 34 +++++++++++++++++++++++++++++++++ devel/p5-Sub-Override/distinfo | 2 ++ devel/p5-Sub-Override/pkg-descr | 10 ++++++++++ devel/p5-Sub-Override/pkg-plist | 5 +++++ 5 files changed, 52 insertions(+) create mode 100644 devel/p5-Sub-Override/Makefile create mode 100644 devel/p5-Sub-Override/distinfo create mode 100644 devel/p5-Sub-Override/pkg-descr create mode 100644 devel/p5-Sub-Override/pkg-plist diff --git a/devel/Makefile b/devel/Makefile index 12ed76141b9a..eb54ecbe12a1 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -1028,6 +1028,7 @@ SUBDIR += p5-String-Random SUBDIR += p5-String-RexxParse SUBDIR += p5-String-Similarity + SUBDIR += p5-Sub-Override SUBDIR += p5-Sub-Uplevel SUBDIR += p5-Sys-Mmap SUBDIR += p5-System2 diff --git a/devel/p5-Sub-Override/Makefile b/devel/p5-Sub-Override/Makefile new file mode 100644 index 000000000000..17180e68d473 --- /dev/null +++ b/devel/p5-Sub-Override/Makefile @@ -0,0 +1,34 @@ +# New ports collection makefile for: p5-Sub-Override +# Date created: January 4th 2005 +# Whom: Lars Eggert +# +# $FreeBSD$ +# + +PORTNAME= Sub-Override +PORTVERSION= 0.06 +CATEGORIES= devel perl5 +MASTER_SITES= ${MASTER_SITE_PERL_CPAN} +MASTER_SITE_SUBDIR= Sub +PKGNAMEPREFIX= p5- + +MAINTAINER= lars.eggert@gmx.net +COMMENT= Perl extension for easily overriding subroutines + +BUILD_DEPENDS= ${SITE_PERL}/Test/Exception.pm:${PORTSDIR}/devel/p5-Test-Exception +RUN_DEPENDS= ${BUILD_DEPENDS} + +PERL_CONFIGURE= yes + +MAN3= Sub::Override.3 + +.include + +## +## this port requires PERL 5.6.x or later +## +.if ${PERL_LEVEL} < 500600 +IGNORE= Port requires perl 5.6.x or later. Install lang/perl5 then try again +.endif + +.include diff --git a/devel/p5-Sub-Override/distinfo b/devel/p5-Sub-Override/distinfo new file mode 100644 index 000000000000..d1d3096bf713 --- /dev/null +++ b/devel/p5-Sub-Override/distinfo @@ -0,0 +1,2 @@ +MD5 (Sub-Override-0.06.tar.gz) = b6827d2ca484318ac5d5bd1820deb5ed +SIZE (Sub-Override-0.06.tar.gz) = 4762 diff --git a/devel/p5-Sub-Override/pkg-descr b/devel/p5-Sub-Override/pkg-descr new file mode 100644 index 000000000000..9232b0523ac1 --- /dev/null +++ b/devel/p5-Sub-Override/pkg-descr @@ -0,0 +1,10 @@ +Sub::Override allows the programmer to simply name the sub to replace +and to supply a sub to replace it with. + + my $override = Sub::Override->new('Some::sub', sub {'new data'}); + + # which is equivalent to: + my $override = Sub::Override->new; + $override->replace('Some::sub', sub { 'new data' }); + +WWW: http://search.cpan.org/dist/Sub-Override/ diff --git a/devel/p5-Sub-Override/pkg-plist b/devel/p5-Sub-Override/pkg-plist new file mode 100644 index 000000000000..a67a15e81b01 --- /dev/null +++ b/devel/p5-Sub-Override/pkg-plist @@ -0,0 +1,5 @@ +%%SITE_PERL%%/Sub/Override.pm +%%SITE_PERL%%/%%PERL_ARCH%%/auto/Sub/Override/.packlist +@dirrm %%SITE_PERL%%/%%PERL_ARCH%%/auto/Sub/Override +@unexec rmdir %D/%%SITE_PERL%%/mach/auto/Sub 2>/dev/null || true +@unexec rmdir %D/%%SITE_PERL%%/Sub 2>/dev/null || true