httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject [A-T patch] extend which() to search under perl's bin
Date Thu, 13 Jan 2005 04:55:40 GMT
Looks like a useful feature, needed to code it manually in libapreq test, 
so why not include it in A-T.

the only question is may be it's better to search perl's bin first and not 
last?

Index: Changes
===================================================================
--- Changes	(revision 124937)
+++ Changes	(working copy)
@@ -8,6 +8,10 @@

  =item 1.20-dev

+extend Apache::TestConfig::which() to search under perl's bin
+directory (in the case of local perl install many utils get installed
+there, but won't be in PATH). [Stas]
+
  Apache::TestConfig::inherit_load_module handles .dll modules
  (previously was only .so) [Stas]

Index: lib/Apache/TestConfig.pm
===================================================================
--- lib/Apache/TestConfig.pm	(revision 124937)
+++ lib/Apache/TestConfig.pm	(working copy)
@@ -1643,7 +1643,13 @@

      return undef unless $program;

-    for my $base (map { catfile($_, $program) } File::Spec->path()) {
+    my @dirs = File::Spec->path();
+
+    require Config;
+    my $perl_bin = $Config::Config{bin} || '';
+    push @dirs, $perl_bin if $perl_bin and -d $perl_bin;
+
+    for my $base (map { catfile $_, $program } @dirs) {
          if ($ENV{HOME} and not WIN32) {
              # only works on Unix, but that's normal:
              # on Win32 the shell doesn't have special treatment of '~'

-- 
__________________________________________________________________
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