line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::TestOnTap::PackInfo; |
2
|
|
|
|
|
|
|
|
3
|
19
|
|
|
19
|
|
151
|
use App::TestOnTap::Util qw(slashify $IS_WINDOWS $IS_PACKED $SHELL_ARG_DELIM $FILE_SEP); |
|
19
|
|
|
|
|
45
|
|
|
19
|
|
|
|
|
2370
|
|
4
|
|
|
|
|
|
|
|
5
|
19
|
|
|
19
|
|
143
|
use Config qw(myconfig); |
|
19
|
|
|
|
|
43
|
|
|
19
|
|
|
|
|
1055
|
|
6
|
19
|
|
|
19
|
|
9235
|
use ExtUtils::Installed; |
|
19
|
|
|
|
|
1987271
|
|
|
19
|
|
|
|
|
796
|
|
7
|
19
|
|
|
19
|
|
670
|
use File::Basename; |
|
19
|
|
|
|
|
264
|
|
|
19
|
|
|
|
|
1235
|
|
8
|
19
|
|
|
19
|
|
128
|
use File::Slurp qw(write_file); |
|
19
|
|
|
|
|
43
|
|
|
19
|
|
|
|
|
784
|
|
9
|
19
|
|
|
19
|
|
112
|
use File::Spec; |
|
19
|
|
|
|
|
42
|
|
|
19
|
|
|
|
|
448
|
|
10
|
19
|
|
|
19
|
|
100
|
use File::Temp qw(tempfile tempdir); |
|
19
|
|
|
|
|
36
|
|
|
19
|
|
|
|
|
942
|
|
11
|
19
|
|
|
19
|
|
592
|
use FindBin qw($RealBin $RealScript); |
|
19
|
|
|
|
|
1033
|
|
|
19
|
|
|
|
|
1910
|
|
12
|
19
|
|
|
19
|
|
134
|
use POSIX; |
|
19
|
|
|
|
|
48
|
|
|
19
|
|
|
|
|
176
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub handle |
15
|
|
|
|
|
|
|
{ |
16
|
0
|
|
|
0
|
0
|
|
my $opts = shift; |
17
|
0
|
|
|
|
|
|
my $version = shift; |
18
|
0
|
|
|
|
|
|
my $_argsPodName = shift; |
19
|
0
|
|
|
|
|
|
my $_argsPodInput = shift; |
20
|
0
|
|
|
|
|
|
my $argsPodName = shift; |
21
|
0
|
|
|
|
|
|
my $argsPodInput = shift; |
22
|
0
|
|
|
|
|
|
my $manualPodName = shift; |
23
|
0
|
|
|
|
|
|
my $manualPodInput = shift; |
24
|
|
|
|
|
|
|
|
25
|
0
|
0
|
|
|
|
|
die("Only one of --_pp, --_pp_script, --_pp_info allowed\n") if grep(/^_(pp)$/, keys(%$opts)) > 1; |
26
|
0
|
0
|
|
|
|
|
if ($opts->{_pp}) { _pp($opts, $version, $_argsPodName, $_argsPodInput, $argsPodName, $argsPodInput, $manualPodName, $manualPodInput); } |
|
0
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
27
|
0
|
|
|
|
|
|
elsif ($opts->{_pp_script}) { _pp_script($opts, $version, $_argsPodName, $_argsPodInput, $argsPodName, $argsPodInput, $manualPodName, $manualPodInput); } |
28
|
0
|
|
|
|
|
|
elsif ($opts->{_pp_info}) { _pp_info($opts); } |
29
|
0
|
|
|
|
|
|
else { die("INTERNAL ERROR"); } |
30
|
|
|
|
|
|
|
|
31
|
0
|
|
|
|
|
|
exit(0); |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub _pp_script |
35
|
|
|
|
|
|
|
{ |
36
|
0
|
|
|
0
|
|
|
my $scriptFile = __internal_pp_script(@_); |
37
|
0
|
|
|
|
|
|
print "Wrote script '$scriptFile'\n"; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
sub _pp |
41
|
|
|
|
|
|
|
{ |
42
|
0
|
|
|
0
|
|
|
my $tmpDir = tempdir('testontap_ppscript_XXXX', TMPDIR => 1, CLEANUP => 1); |
43
|
0
|
|
|
|
|
|
$_[0]->{_pp_script} = "$tmpDir/testontap_pp.pl"; |
44
|
0
|
|
|
|
|
|
my $scriptFile = __internal_pp_script(@_); |
45
|
0
|
|
|
|
|
|
system("$^X $SHELL_ARG_DELIM$scriptFile$SHELL_ARG_DELIM"); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub _pp_info |
49
|
|
|
|
|
|
|
{ |
50
|
0
|
|
|
0
|
|
|
my $opts = shift; |
51
|
|
|
|
|
|
|
|
52
|
0
|
0
|
|
|
|
|
die("Sorry, you're not running a binary/packed instance\n") unless $IS_PACKED; |
53
|
|
|
|
|
|
|
|
54
|
0
|
|
|
|
|
|
print "$0\n"; |
55
|
0
|
|
|
|
|
|
foreach my $sec (qw(USERNAME HOSTNAME CONFIG ENV MODULES CMD)) |
56
|
|
|
|
|
|
|
{ |
57
|
0
|
|
|
|
|
|
print "### $sec BEGIN\n"; |
58
|
0
|
|
|
|
|
|
print PAR::read_file("TESTONTAP_${sec}_FILE"); |
59
|
0
|
|
|
|
|
|
print "### $sec END\n"; |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
### |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub __construct_outfilename |
66
|
|
|
|
|
|
|
{ |
67
|
0
|
|
|
0
|
|
|
my $version = shift; |
68
|
|
|
|
|
|
|
|
69
|
0
|
0
|
|
|
|
|
my $os = $IS_WINDOWS ? 'windows' : $^O; |
70
|
0
|
|
|
|
|
|
my $arch = (POSIX::uname())[4]; |
71
|
0
|
0
|
|
|
|
|
my $exeSuffix = $IS_WINDOWS ? '.exe' : ''; |
72
|
0
|
|
|
|
|
|
my $bnScript = basename($RealScript); |
73
|
|
|
|
|
|
|
|
74
|
0
|
|
|
|
|
|
return "$bnScript-$version-$os-$arch$exeSuffix"; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
sub __internal_pp_script |
78
|
|
|
|
|
|
|
{ |
79
|
0
|
|
|
0
|
|
|
my $opts = shift; |
80
|
0
|
|
|
|
|
|
my $version = shift; |
81
|
0
|
|
|
|
|
|
my $_argsPodName = shift; |
82
|
0
|
|
|
|
|
|
my $x__argsPodInput = slashify(File::Spec->rel2abs(shift), '/'); |
83
|
0
|
|
|
|
|
|
my $argsPodName = shift; |
84
|
0
|
|
|
|
|
|
my $x_argsPodInput = slashify(File::Spec->rel2abs(shift), '/'); |
85
|
0
|
|
|
|
|
|
my $manualPodName = shift; |
86
|
0
|
|
|
|
|
|
my $x_manualPodInput = slashify(File::Spec->rel2abs(shift), '/'); |
87
|
|
|
|
|
|
|
|
88
|
0
|
0
|
|
|
|
|
die("Sorry, you're already running a binary/packed instance\n") if $IS_PACKED; |
89
|
|
|
|
|
|
|
|
90
|
0
|
|
|
|
|
|
my $scriptFile = slashify(File::Spec->rel2abs($opts->{_pp_script})); |
91
|
0
|
0
|
|
|
|
|
die("The path '$scriptFile' already exists\n") if -e $scriptFile; |
92
|
|
|
|
|
|
|
|
93
|
0
|
|
|
|
|
|
my $x_input = slashify("$RealBin/$RealScript", '/'); |
94
|
0
|
|
|
|
|
|
my $x_output = __construct_outfilename($version); |
95
|
0
|
0
|
|
|
|
|
my $x_verbose = $opts->{verbose} ? 1 : 0; |
96
|
0
|
|
|
|
|
|
my $x_fsep = $FILE_SEP; |
97
|
0
|
0
|
|
|
|
|
$x_fsep .= "\\" if $x_fsep eq "\\"; |
98
|
|
|
|
|
|
|
|
99
|
0
|
|
|
|
|
|
my $x_liblocs = "my \@liblocs;\n"; |
100
|
0
|
|
|
|
|
|
foreach my $libloc (@INC) |
101
|
|
|
|
|
|
|
{ |
102
|
0
|
0
|
0
|
|
|
|
next if ($libloc eq '.' || ref($libloc)); |
103
|
0
|
|
|
|
|
|
$x_liblocs .= "push(\@liblocs, '-I', '" . slashify(File::Spec->rel2abs($libloc), '/') . "');\n"; |
104
|
|
|
|
|
|
|
} |
105
|
0
|
|
|
|
|
|
chomp($x_liblocs); |
106
|
|
|
|
|
|
|
|
107
|
0
|
|
|
|
|
|
my $script = < |