You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by au...@apache.org on 2006/07/05 17:14:23 UTC

svn commit: r419251 - /perl/Apache-SizeLimit/trunk/Makefile.PL

Author: autarch
Date: Wed Jul  5 08:14:23 2006
New Revision: 419251

URL: http://svn.apache.org/viewvc?rev=419251&view=rev
Log:
Simplify the Apache::Test-related code down to the least bit of code
that seems to work. There was some cruft in here that seemed to have
been cut'n'paste relics, and some things that looked a bit cargo
cult-ish. Review would be appreciated.

You can test the "no Apache::Test" case by changing
check_for_apache_test() to simply "return 0" at the top of the sub. In
both cases, it seems to work and do the right thing for me.

Modified:
    perl/Apache-SizeLimit/trunk/Makefile.PL

Modified: perl/Apache-SizeLimit/trunk/Makefile.PL
URL: http://svn.apache.org/viewvc/perl/Apache-SizeLimit/trunk/Makefile.PL?rev=419251&r1=419250&r2=419251&view=diff
==============================================================================
--- perl/Apache-SizeLimit/trunk/Makefile.PL (original)
+++ perl/Apache-SizeLimit/trunk/Makefile.PL Wed Jul  5 08:14:23 2006
@@ -37,20 +37,18 @@
         1;
     };
 
-    Apache::TestMM->import(qw(test clean));
     Apache::TestMM::filter_args();
-
-    my %args = @Apache::TestMM::Argv;
-
     Apache::TestRunPerl->generate_script();
 
     return 1;
 }
 
-sub MY::postamble {
+package MY;
+
+sub postamble {
     my $self = shift;
 
-    my $string = $self->MM::postamble;
+    my $string = $self->SUPER::postamble;
 
     $string .= <<'EOF';
 tag :
@@ -61,7 +59,7 @@
     return $string;
 }
 
-sub MY::test {
+sub test {
     my $self = shift;
 
     eval { require Test::More } or return <<EOF;
@@ -69,15 +67,15 @@
 \t\@echo sorry, cannot run tests without Test::More
 EOF
 
-    return Apache::TestMM::test(@_) if $HAS_APACHE_TEST;
+    return $self->Apache::TestMM::test(@_) if $HAS_APACHE_TEST;
 
-    return $self->MM::test(@_);
+    return $self->SUPER::test(@_);
 }
 
-sub MY::clean {
+sub clean {
     my $self = shift;
 
-    return Apache::TestMM::clean(@_) if $HAS_APACHE_TEST;
+    return $self->Apache::TestMM::clean(@_) if $HAS_APACHE_TEST;
 
-    return shift->MM::clean(@_);
+    return $self->SUPER::clean(@_);
 }



Re: svn commit: r419251 - /perl/Apache-SizeLimit/trunk/Makefile.PL

Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
Dave Rolsky wrote:
> I can't call SUPER:: without having the code be in a defined package.
> I'd prefer to have it call SUPER:: rather than hard-coding a particular
> package, it's just cleaner.
Okay, I'm sold.

-- 
------------------------------------------------------------------------
Philip M. Gollucci (pgollucci@p6m7g8.com) 323.219.4708
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - TicketMaster - http://ticketmaster.com
1024D/A79997FA F357 0FDD 2301 6296 690F  6A47 D55A 7172 A799 97F

"It takes a minute to have a crush on someone, an hour to like someone,
and a day to love someone, but it takes a lifetime to forget someone..."

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: svn commit: r419251 - /perl/Apache-SizeLimit/trunk/Makefile.PL

Posted by Dave Rolsky <au...@urth.org>.
On Thu, 6 Jul 2006, Philip M. Gollucci wrote:

> autarch@apache.org wrote:
>> -sub MY::postamble {
>> +package MY;
>> +
>> +sub postamble {
>>      my $self = shift;
>> -sub MY::test {
>> +sub test {
>> -sub MY::clean {
>> +sub clean {
>
> While that works, Its not consistent with any of our other Makefile.PL's do we want to be consistent, or does it not
> matter ?

I can't call SUPER:: without having the code be in a defined package. I'd 
prefer to have it call SUPER:: rather than hard-coding a particular 
package, it's just cleaner.


-dave

/*===================================================
VegGuide.Org                        www.BookIRead.com
Your guide to all that's veg.       My book blog
===================================================*/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: svn commit: r419251 - /perl/Apache-SizeLimit/trunk/Makefile.PL

Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
autarch@apache.org wrote:
> -sub MY::postamble {
> +package MY;
> +
> +sub postamble {
>      my $self = shift;
> -sub MY::test {
> +sub test {
> -sub MY::clean {
> +sub clean {

While that works, Its not consistent with any of our other Makefile.PL's do we want to be consistent, or does it not
matter ?


-- 
------------------------------------------------------------------------
Philip M. Gollucci (pgollucci@p6m7g8.com) 323.219.4708
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - TicketMaster - http://ticketmaster.com
1024D/A79997FA F357 0FDD 2301 6296 690F  6A47 D55A 7172 A799 97F

"In all that I've done wrong I know I must have done something right to
deserve a hug every morning and butterfly kisses at night."

Re: svn commit: r419251 - /perl/Apache-SizeLimit/trunk/Makefile.PL

Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
autarch@apache.org wrote:
> -sub MY::postamble {
> +package MY;
> +
> +sub postamble {
>      my $self = shift;
> -sub MY::test {
> +sub test {
> -sub MY::clean {
> +sub clean {

While that works, Its not consistent with any of our other Makefile.PL's do we want to be consistent, or does it not
matter ?


-- 
------------------------------------------------------------------------
Philip M. Gollucci (pgollucci@p6m7g8.com) 323.219.4708
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - TicketMaster - http://ticketmaster.com
1024D/A79997FA F357 0FDD 2301 6296 690F  6A47 D55A 7172 A799 97F

"In all that I've done wrong I know I must have done something right to
deserve a hug every morning and butterfly kisses at night."

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org