line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Alien::MSYS; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
201436
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
25
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
18
|
|
5
|
1
|
|
|
1
|
|
750
|
use Path::Tiny (); |
|
1
|
|
|
|
|
10238
|
|
|
1
|
|
|
|
|
25
|
|
6
|
1
|
|
|
1
|
|
803
|
use Env qw( @PATH ); |
|
1
|
|
|
|
|
2347
|
|
|
1
|
|
|
|
|
5
|
|
7
|
1
|
|
|
1
|
|
139
|
use base qw( Alien::Base Exporter ); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
510
|
|
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.17'; # 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
|
160467
|
my $class = 'Alien::MSYS'; |
44
|
|
|
|
|
|
|
|
45
|
1
|
50
|
|
|
|
9
|
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__ |