line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Alien::MSYS; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
199494
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
26
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
22
|
|
5
|
1
|
|
|
1
|
|
747
|
use Path::Tiny (); |
|
1
|
|
|
|
|
10301
|
|
|
1
|
|
|
|
|
29
|
|
6
|
1
|
|
|
1
|
|
929
|
use Env qw( @PATH ); |
|
1
|
|
|
|
|
2352
|
|
|
1
|
|
|
|
|
8
|
|
7
|
1
|
|
|
1
|
|
164
|
use base qw( Alien::Base Exporter ); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
548
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our @EXPORT = qw( msys msys_run ); |
10
|
|
|
|
|
|
|
our @EXPORT_OK = qw( msys msys_run msys_path ); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# ABSTRACT: Tools required for GNU style configure scripts on Windows |
13
|
|
|
|
|
|
|
our $VERSION = '0.15'; # VERSION |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub msys (&) |
17
|
|
|
|
|
|
|
{ |
18
|
0
|
|
|
0
|
1
|
0
|
local $ENV{PATH} = $ENV{PATH}; |
19
|
0
|
0
|
|
|
|
0
|
if($^O eq 'MSWin32') |
20
|
|
|
|
|
|
|
{ |
21
|
0
|
|
|
|
|
0
|
unshift @PATH, msys_path(); |
22
|
|
|
|
|
|
|
} |
23
|
0
|
|
|
|
|
0
|
$_[0]->(); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub msys_run |
28
|
|
|
|
|
|
|
{ |
29
|
0
|
|
|
0
|
1
|
0
|
my $cmd = \@_; |
30
|
0
|
0
|
|
|
|
0
|
$cmd = \@ARGV unless @$cmd > 0; |
31
|
0
|
|
|
0
|
|
0
|
msys { system @$cmd }; |
|
0
|
|
|
|
|
0
|
|
32
|
|
|
|
|
|
|
# child did an exit(0), or "success" |
33
|
0
|
0
|
|
|
|
0
|
return if $? == 0; |
34
|
|
|
|
|
|
|
# child wasn't able to exit (-1) or died with signal |
35
|
0
|
0
|
0
|
|
|
0
|
exit 2 if $? == -1 || $? & 127; |
36
|
|
|
|
|
|
|
# child exited with non zero |
37
|
0
|
|
|
|
|
0
|
exit $?; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub msys_path () |
42
|
|
|
|
|
|
|
{ |
43
|
1
|
|
|
1
|
1
|
168431
|
my $class = 'Alien::MSYS'; |
44
|
|
|
|
|
|
|
|
45
|
1
|
50
|
|
|
|
8
|
return if $^O ne 'MSWin32'; |
46
|
|
|
|
|
|
|
|
47
|
0
|
0
|
|
|
|
|
if($class->install_type('share')) |
48
|
|
|
|
|
|
|
{ |
49
|
0
|
|
|
|
|
|
return Path::Tiny->new($class->dist_dir)->child('msys/1.0/bin')->canonpath; |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
else |
52
|
|
|
|
|
|
|
{ |
53
|
0
|
|
|
|
|
|
return Path::Tiny->new($class->runtime_prop->{my_bin})->canonpath; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
1; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
__END__ |