On Sun, 30 Nov 2003, Randy Kobes wrote:

> On Sun, 30 Nov 2003, Stas Bekman wrote:
[ .. ]
> > Ah, what do you get as a response? a path like
> > /tmp/foo.pl on win32? In which case the problem would be
> > coming from:
> >
> >      $_[0]->{FILENAME} = $_[1]->filename;
> >
> > in RegistryCooker.pm, which sets $0, eventually printed by cgi-bin/basic.pl.
> > Does $r->filename return a unix path on winFU?
>
> I guess one could look at it from both ends ... I was
> thinking here that the problem was in the way that
> $script_file was constructed with catfile, which on
> Win32 came out as SERVER_ROOT\cgi-bin\basic.pl. So the
> patch above changes this to SERVER_ROOT/cgi-bin/basic.pl,
> which agrees with the response.

Further to this, I think most people on Win32 (and probably
all non-Unices) are used to using '/' as a directory
separator when inside a web environment (eg, in constructing
urls). So I would think that SERVER_ROOT/cgi-bin/basic.pl
is the correct cross-platform value ...

However (I hate bringing this up :(, on Win32 there's
problems with sometimes the dos short path name being
used and then compared with the long path name
(eg, MODPER~1.0 vs modperl-2.0). This in principle
is what needs to be done to get t/basic.t and t/redirect.t
to pass under ModPerl-Registry:
============================================================
Index: t/basic.t
===================================================================
RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/basic.t,v
retrieving revision 1.15
diff -u -r1.15 basic.t
--- t/basic.t   23 Nov 2003 21:01:50 -0000      1.15
+++ t/basic.t   1 Dec 2003 04:23:37 -0000
@@ -6,7 +6,7 @@
 use Apache::TestRequest qw(GET GET_BODY HEAD);
 use Apache::TestConfig ();

-use File::Spec::Functions qw(catfile);
+use File::Spec::Unix;

 my %modules = (
     registry    => 'ModPerl::Registry',
@@ -19,7 +19,9 @@
 plan tests => @aliases * 4 + 3;

 my $vars = Apache::Test::config()->{vars};
-my $script_file = catfile $vars->{serverroot}, 'cgi-bin', 'basic.pl';
+my $script_file = File::Spec::Unix->catfile($vars->{serverroot}, 'cgi-bin', 
'basic.pl');
+$script_file = Win32::GetLongPathName($script_file)
+    if Apache::TestConfig::WIN32;

 # very basic compilation/response test
 for my $alias (@aliases) {
Index: t/redirect.t
===================================================================
RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/redirect.t,v
retrieving revision 1.6
diff -u -r1.6 redirect.t
--- t/redirect.t        23 Nov 2003 21:01:50 -0000      1.6
+++ t/redirect.t        1 Dec 2003 04:23:37 -0000
@@ -5,7 +5,7 @@
 use Apache::TestUtil;
 use Apache::TestRequest qw(GET_BODY HEAD);

-use File::Spec::Functions qw(catfile);
+use File::Spec::Unix;

 plan tests => 4, have_lwp;

@@ -16,7 +16,9 @@
     my $redirect_path = "/registry/basic.pl";
     my $url = "$base_url?$redirect_path";
     my $vars = Apache::Test::config()->{vars};
-    my $script_file = catfile $vars->{serverroot}, 'cgi-bin', 'basic.pl';
+    my $script_file = File::Spec::Unix->catfile($vars->{serverroot}, 'cgi-bin', 
'basic.pl');
+    $script_file = Win32::GetLongPathName($script_file)
+        if Apache::TestConfig::WIN32;

     ok t_cmp(
         "ok $script_file",
==================================================================

but it's not pretty ...

-- 
best regards,
randy

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to