httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: cvs commit: httpd-apreq-2/build xsbuilder.pl
Date Thu, 12 Jun 2003 07:13:17 GMT
Randy Kobes wrote:
> On Thu, 12 Jun 2003, Stas Bekman wrote:
> 
> 
>>randyk@apache.org wrote:
>>
>>
>>>  Modified:    build    xsbuilder.pl
>>>  Log:
>>>  Reviewed by:	joes
>>>  For Win32,
>>>  - ensure cwd is a long path name, in order to get the base directory
>>>  - obtain the Apache include and lib directories without relying on
>>>    a config.status
>>>  - adjust the library locations and names for WriteMakefile
>>>
>>>  Revision  Changes    Path
>>>  1.6       +26 -9     httpd-apreq-2/build/xsbuilder.pl
>>>
>>>  Index: xsbuilder.pl
>>>  ===================================================================
>>>  RCS file: /home/cvs/httpd-apreq-2/build/xsbuilder.pl,v
>>>  retrieving revision 1.5
>>>  retrieving revision 1.6
>>>  diff -u -r1.5 -r1.6
>>>  --- xsbuilder.pl	10 Jun 2003 14:43:10 -0000	1.5
>>>  +++ xsbuilder.pl	12 Jun 2003 05:55:32 -0000	1.6
>>>  @@ -8,9 +8,12 @@
>>>   use warnings FATAL => 'all';
>>>   use Apache2;
>>>   use Apache::Build;
>>>  +require Win32 if Apache::Build::WIN32;
>>>
>>>   use Cwd;
>>>  -cwd =~ m{^(.+httpd-apreq-2)} or die "Can't find base cvs directory";
>>>  +my $cwd = Apache::Build::WIN32 ?
>>>  +    Win32::GetLongPathName(cwd) : cwd;
>>>  +$cwd =~ m{^(.+httpd-apreq-2)} or die "Can't find base cvs directory";
>>
> [ .. ]
> 
>>May I suggest using FindBin here? You don't need special WIN32
>>case if you do that, I think.
>>use FindBin;
>>$FindBin::Bin =~ /httpd-apreq-2/ or die "Can't find base cvs directory";
> 
> 
> Unfortunately, that runs into the same problem ... What's
> happening is that the source directory (httpd-apreq-2) is longer
> than 6 characters, so $FindBin::Bin (or cwd) reports something
> like C:/MyFiles/HTTPD-~3/build, which is the dos short path name.
> The "3" in the name is due to the fact that, at the same level, I
> have a httpd-apreq and a httpd-apreq-2-dev directory. So I think
> converting it to the long path name is the simplest way to go ...

Understood. But using FindBin is better than Cwd in general, I believe, 
because it allows you to invoke the same script as foo/bar.pl ./bar.pl or even 
/full/path/to/bar.pl and using FindBin it'll always do the right thing, 
whereas it won't with Cwd.

so perhaps doing Win32::GetLongPathName($FindBin::Bin) works?


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Mime
View raw message