Author: kwilliams
Date: Tue Dec 26 21:47:51 2006
New Revision: 8475

Modified:
   Module-Build/trunk/Changes
   Module-Build/trunk/t/lib/MBTest.pm

Log:
Need to know some .exe-like extensions on OS/2

Modified: Module-Build/trunk/Changes
==============================================================================
--- Module-Build/trunk/Changes  (original)
+++ Module-Build/trunk/Changes  Tue Dec 26 21:47:51 2006
@@ -1,5 +1,8 @@
 Revision history for Perl extension Module::Build.
 
+ - In our test-time utility library t/lib/MBTest.pm, we need to know
+   about a few .exe-like extensions on OS/2. [Ilya Zakharevich]
+
  - In t/ppm.t, use DynaLoader::mod2fname() (if available) to determine
    the correct translation of our test module's name into a DLL
    name. [Ilya Zakharevich]

Modified: Module-Build/trunk/t/lib/MBTest.pm
==============================================================================
--- Module-Build/trunk/t/lib/MBTest.pm  (original)
+++ Module-Build/trunk/t/lib/MBTest.pm  Tue Dec 26 21:47:51 2006
@@ -74,16 +74,26 @@
   return scalar <$fh>;
 }
 
+sub exe_exts {
+  # Some extensions we should know about if we're looking for executables
+
+  if ($^O eq 'MSWin32') {
+    return split($Config{path_sep}, $ENV{PATHEXT} || '.com;.exe;.bat');
+  }
+  if ($^O eq 'os2') {
+    return qw(.exe .com .pl .cmd .bat .sh .ksh);
+  }
+  return;
+}
+
 sub find_in_path {
   my $thing = shift;
   
   my @path = split $Config{path_sep}, $ENV{PATH};
-  my @exe_ext = $^O eq 'MSWin32' ? ('', # may have extension already
-    split($Config{path_sep}, $ENV{PATHEXT} || '.com;.exe;.bat')) :
-    ('');
+  my @exe_ext = exe_exts();
   foreach (@path) {
     my $fullpath = File::Spec->catfile($_, $thing);
-    foreach my $ext ( @exe_ext ) {
+    foreach my $ext ( '', @exe_ext ) {
       return "$fullpath$ext" if -e "$fullpath$ext";
     }
   }

Reply via email to