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