Changeset 8920 for inc

Show
Ignore:
Timestamp:
02/01/06 19:09:36 (3 years ago)
Author:
gaal
Message:

* inc/Module/Install/Can.pm: cygwin can have hybrid ideas about what

constitutes an executable; replace "-x" there with something that
allows us to find GHC in the path.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • inc/Module/Install/Can.pm

    r8661 r8920  
    2626sub can_run { 
    2727    my ($self, $cmd) = @_; 
     28    # XXX: what to do in native win32? 
     29    my $mx = $^O eq 'cygwin' ? 
     30        sub { -x $_[0] || (-f _ && $_[0] =~ /\.(exe|com|bat)$/) } : 
     31        sub { -x $_[0] }; 
    2832 
    2933    my $_cmd = $cmd; 
    30     return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd)); 
     34    return $_cmd if ($mx->($_cmd) or $_cmd = MM->maybe_command($_cmd)); 
    3135 
    3236    for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') { 
    3337        my $abs = File::Spec->catfile($dir, $_[1]); 
    34         return $abs if (-x $abs or $abs = MM->maybe_command($abs)); 
     38        return $abs if ($mx->($abs) or $abs = MM->maybe_command($abs)); 
    3539    } 
    3640