On Sun, 1 Oct 2000, Randy Kobes wrote:
> Hi,
> Regarding the problem of the mod_perl tests
> not recognizing Apache::Cookie and Apache::Request
> on Win32 after they've been installed, as Jiho found,
> this was due to Win32 not having a populated
> %callback_hooks in t/net/config.pl. For Unix
> systems, this information is appended to config.pl
> in the init_tests_and_config sub in the top-level
> Makefile.PL, which is skipped on Win32. The patch
> below, applied to the current mod_perl cvs version,
> appends, for Win32, the %callback_hooks
> to config.pl. With this patch, the tests for Apache::Cookie
> and Apache::Request are run on Win32 when these
> modules are installed (and all pass, with a suitably
> patched libapreq for Win32).
thanks randy. how about this version of your patch, which just moves that
hunk of code into it's own routine, that's called by
init_tests_and_config() and by itself if $Is_Win32 ?
Index: Makefile.PL
===================================================================
RCS file: /home/cvs/modperl/Makefile.PL,v
retrieving revision 1.169
diff -u -r1.169 Makefile.PL
--- Makefile.PL 2000/09/27 17:55:21 1.169
+++ Makefile.PL 2000/10/02 20:32:44
@@ -865,6 +865,8 @@
cp "t/net/config.pl.dist", "t/net/config.pl";
}
+init_config_pl() if $Is_Win32;
+
write_my_config($APACHE_SRC);
unless($Is_Win32 or -e "t/conf/httpd.conf" or ($NO_HTTPD && !$PREP_HTTPD)) {
@@ -873,6 +875,32 @@
init_tests_and_config() if $USE_APXS;
+sub init_config_pl {
+ my $mmn = magic_number($APACHE_SRC) || 0;
+
+ my $hf = FileHandle->new(">>t/net/config.pl") or
+ die "can't open t/net/config.pl $!";
+
+ my $apaci_cfg = APACI->init;
+
+ my($k,$v);
+ my(%all) = %callback_hooks;
+ while (($k,$v) = each %experimental) {
+ $all{$k} = ($experimental{$k} > 1) ? 1 : 0;
+ }
+ print $hf "%callback_hooks = (\n";
+ while (($k,$v) = each %all) {
+ print $hf " $k => $v,\n";
+ my $yes_no = $v ? "yes" : "no";
+ print $apaci_cfg "$k = $yes_no\n" if $apaci_cfg;
+ }
+ print $hf " MMN => $mmn,\n";
+ print $hf " USE_DSO => 1,\n" if $USE_DSO;
+ print $hf ");\n1;\n";
+ $hf->close;
+ $apaci_cfg->close if $apaci_cfg;
+}
+
sub init_tests_and_config {
local *FH;
open FH, ">t/conf/dev-null";
@@ -913,31 +941,8 @@
iedit "t/conf/httpd.conf", "s/^#(PerlOpmask)/\$1/";
}
}
- {
- my $mmn = magic_number($APACHE_SRC) || 0;
-
- my $hf = FileHandle->new(">>t/net/config.pl") or
- die "can't open t/net/config.pl $!";
-
- my $apaci_cfg = APACI->init;
- my($k,$v);
- my(%all) = %callback_hooks;
- while(($k,$v) = each %experimental) {
- $all{$k} = ($experimental{$k} > 1) ? 1 : 0;
- }
- print $hf "%callback_hooks = (\n";
- while(($k,$v) = each %all) {
- print $hf " $k => $v,\n";
- my $yes_no = $v ? "yes" : "no";
- print $apaci_cfg "$k = $yes_no\n" if $apaci_cfg;
- }
- print $hf " MMN => $mmn,\n";
- print $hf " USE_DSO => 1,\n" if $USE_DSO;
- print $hf ");\n1;\n";
- $hf->close;
- $apaci_cfg->close if $apaci_cfg;
- }
+ init_config_pl();
if($USE_APACI and not $PREP_HTTPD and not $USE_APXS) {
my $shrpenv = $Config{shrpenv} || "";
@@ -1962,6 +1967,7 @@
}
sub APACI::init {
+ return undef if $Is_Win32;
my $lib_cfg;
if($USE_APXS) {
$lib_cfg = "apaci/mod_perl.config";
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]