Re: [patch] a cleaner make clean

2001-09-10 Thread Doug MacEachern
On Mon, 10 Sep 2001, Stas Bekman wrote:

> Index: perl-framework/Makefile.PL

looks good, +1




Re: [patch] a cleaner make clean

2001-09-10 Thread Stas Bekman
> just move that to Apache::TestMM (without the MY::), then:
> use Apache::TestMM qw(test clean);
>
> should work.

Index: perl-framework/Makefile.PL
===
RCS file: /home/cvs/httpd-test/perl-framework/Makefile.PL,v
retrieving revision 1.5
diff -u -r1.5 Makefile.PL
--- perl-framework/Makefile.PL  2001/08/21 05:15:37 1.5
+++ perl-framework/Makefile.PL  2001/09/10 01:49:02
@@ -3,7 +3,7 @@
 use 5.006;

 use lib qw(Apache-Test/lib);
-use Apache::TestMM qw(test);
+use Apache::TestMM qw(test clean);

 use File::Find qw(finddepth);

Index: perl-framework/Apache-Test/lib/Apache/TestMM.pm
===
RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestMM.pm,v
retrieving revision 1.10
diff -u -r1.10 TestMM.pm
--- perl-framework/Apache-Test/lib/Apache/TestMM.pm 2001/08/12 19:22:29 
1.10
+++ perl-framework/Apache-Test/lib/Apache/TestMM.pm 2001/09/10 01:49:02
@@ -21,6 +21,18 @@
 }
 }

+sub add_dep {
+my($string, $targ, $add) = @_;
+$$string =~ s/($targ\s+::)/$1 $add /;
+}
+
+sub clean {
+my $self = shift;
+my $string = $self->MM::clean(@_);
+add_dep(\$string, clean => 'test_clean');
+$string;
+}
+
 sub test {

 my $env = Apache::TestConfig->passenv_makestr();

_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/




Re: [patch] a cleaner make clean

2001-09-09 Thread Doug MacEachern
On Sun, 9 Sep 2001, Stas Bekman wrote:
 
> I don't think this will work via import() trick since you still want to
> reach the thing in: $self->MM::clean(@_); and you cannot before you call
> WriteMakefile.

it does work.  look at Apache::TestMM::import, it sets up aliases in the
%MY:: namespace.

> > similar to how you can already to for 'test'.
> 
> Here is how I've approached it (stolen from mod_perl's Makefile.PL):

> +sub MY::clean {
> +my $self = shift;
> +my $string = $self->MM::clean(@_);
> +Apache::TestMM::add_dep(\$string, clean => 'test_clean');
> +$string;
> +}

just move that to Apache::TestMM (without the MY::), then:
use Apache::TestMM qw(test clean);

should work.




Re: [patch] a cleaner make clean

2001-09-09 Thread Stas Bekman
On Sat, 8 Sep 2001, Doug MacEachern wrote:

> On Sat, 8 Sep 2001, Stas Bekman wrote:
>
> >
> > all autogenerated files should be cleaned.
>
> true.
>
> > +my @clean_conf = map { "t/conf/$_" }
> > +qw(*.conf apache_test_config.pm ssl/ssl.conf);
>
> but we should really hook into calling 't/TEST -clean'
> via Apache::TestMM, so for example Makefile.PL's just need to:
> use Apache::TestMM qw(clean);

I don't think this will work via import() trick since you still want to
reach the thing in: $self->MM::clean(@_); and you cannot before you call
WriteMakefile.

> similar to how you can already to for 'test'.

Here is how I've approached it (stolen from mod_perl's Makefile.PL):

Index: Makefile.PL
===
RCS file: /home/cvs/httpd-test/perl-framework/Makefile.PL,v
retrieving revision 1.5
diff -u -r1.5 Makefile.PL
--- Makefile.PL 2001/08/21 05:15:37 1.5
+++ Makefile.PL 2001/09/09 15:12:14
@@ -26,3 +26,10 @@
 VERSION => '0.01',
 clean => { FILES => "@scripts t/TEST" },
 );
+
+sub MY::clean {
+my $self = shift;
+my $string = $self->MM::clean(@_);
+Apache::TestMM::add_dep(\$string, clean => 'test_clean');
+$string;
+}
Index: Apache-Test/lib/Apache/TestMM.pm
===
RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestMM.pm,v
retrieving revision 1.10
diff -u -r1.10 TestMM.pm
--- Apache-Test/lib/Apache/TestMM.pm2001/08/12 19:22:29 1.10
+++ Apache-Test/lib/Apache/TestMM.pm2001/09/09 15:12:14
@@ -21,6 +21,12 @@
 }
 }

+sub add_dep {
+my($string, $targ, $add) = @_;
+$$string =~ s/($targ\s+::)/$1 $add /;
+}
+
+
 sub test {

 my $env = Apache::TestConfig->passenv_makestr();


_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/




Re: [patch] a cleaner make clean

2001-09-08 Thread Doug MacEachern
On Sat, 8 Sep 2001, Stas Bekman wrote:

> 
> all autogenerated files should be cleaned.

true.
 
> +my @clean_conf = map { "t/conf/$_" }
> +qw(*.conf apache_test_config.pm ssl/ssl.conf);

but we should really hook into calling 't/TEST -clean'
via Apache::TestMM, so for example Makefile.PL's just need to:
use Apache::TestMM qw(clean);

similar to how you can already to for 'test'.




[patch] a cleaner make clean

2001-09-08 Thread Stas Bekman

all autogenerated files should be cleaned.

Index: perl-framework/Makefile.PL
===
RCS file: /home/cvs/httpd-test/perl-framework/Makefile.PL,v
retrieving revision 1.5
diff -u -r1.5 Makefile.PL
--- perl-framework/Makefile.PL  2001/08/21 05:15:37 1.5
+++ perl-framework/Makefile.PL  2001/09/08 07:49:13
@@ -21,8 +21,11 @@
 Apache::TestMM::filter_args();
 Apache::TestMM::generate_script('t/TEST');

+my @clean_conf = map { "t/conf/$_" }
+qw(*.conf apache_test_config.pm ssl/ssl.conf);
+
 WriteMakefile(
 NAME => 'httpd-test',
 VERSION => '0.01',
-clean => { FILES => "@scripts t/TEST" },
+clean => { FILES => "@scripts t/TEST @clean_conf" },
 );




_
Stas Bekman  JAm_pH --   Just Another mod_perl Hacker
http://stason.org/   mod_perl Guide  http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]   http://apachetoday.com http://eXtropia.com/
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/