line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
186081
|
use strict; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
24
|
|
2
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
18
|
|
3
|
1
|
|
|
1
|
|
24
|
use 5.014; |
|
1
|
|
|
|
|
3
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use Getopt::Long qw( GetOptions ); |
7
|
1
|
|
|
1
|
|
634
|
use Pod::Usage qw( pod2usage ); |
|
1
|
|
|
|
|
8752
|
|
|
1
|
|
|
|
|
4
|
|
8
|
1
|
|
|
1
|
|
578
|
use Path::Tiny qw( path ); |
|
1
|
|
|
|
|
31980
|
|
|
1
|
|
|
|
|
61
|
|
9
|
1
|
|
|
1
|
|
705
|
|
|
1
|
|
|
|
|
9887
|
|
|
1
|
|
|
|
|
1213
|
|
10
|
|
|
|
|
|
|
# ABSTRACT: Command line interface to Alien::Base |
11
|
|
|
|
|
|
|
# VERSION |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
{ |
15
|
|
|
|
|
|
|
my($alien) = @_; |
16
|
|
|
|
|
|
|
my $class = ref $alien; |
17
|
0
|
|
|
0
|
|
|
eval { $class->VERSION }; |
18
|
0
|
|
|
|
|
|
} |
19
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
{ |
21
|
|
|
|
|
|
|
my($alien) = @_; |
22
|
|
|
|
|
|
|
return $alien->version if $alien->can('version'); |
23
|
|
|
|
|
|
|
return 'unknown' unless $alien->can('config'); |
24
|
0
|
|
|
0
|
|
|
my $ver = $alien->config('version'); |
25
|
0
|
0
|
|
|
|
|
chomp $ver; |
26
|
0
|
0
|
|
|
|
|
$ver; |
27
|
0
|
|
|
|
|
|
} |
28
|
0
|
|
|
|
|
|
|
29
|
0
|
|
|
|
|
|
{ |
30
|
|
|
|
|
|
|
my($dir_sep, $alien) = @_; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
join( $dir_sep, $alien->bin_dir ); |
33
|
|
|
|
|
|
|
} |
34
|
0
|
|
|
0
|
|
|
|
35
|
|
|
|
|
|
|
{ |
36
|
0
|
|
|
|
|
|
my($alien) = @_; |
37
|
|
|
|
|
|
|
scalar $alien->cflags; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
{ |
41
|
0
|
|
|
0
|
|
|
my($alien) = @_; |
42
|
0
|
|
|
|
|
|
scalar $alien->libs; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
{ |
46
|
|
|
|
|
|
|
local(undef, @ARGV) = @_; |
47
|
0
|
|
|
0
|
|
|
|
48
|
0
|
|
|
|
|
|
my $bin_dir; |
49
|
|
|
|
|
|
|
my $dir_sep = ' '; |
50
|
|
|
|
|
|
|
my $cflags; |
51
|
|
|
|
|
|
|
my $libs; |
52
|
|
|
|
|
|
|
my $dll; |
53
|
0
|
|
|
0
|
0
|
|
my $modversion; |
54
|
|
|
|
|
|
|
my $detail; |
55
|
0
|
|
|
|
|
|
my $status = 0; |
56
|
0
|
|
|
|
|
|
|
57
|
0
|
|
|
|
|
|
GetOptions( |
58
|
|
|
|
|
|
|
"bin-dir" => \$bin_dir, |
59
|
0
|
|
|
|
|
|
"dir-sep" => \$dir_sep, |
60
|
0
|
|
|
|
|
|
"cflags" => \$cflags, |
61
|
0
|
|
|
|
|
|
"libs" => \$libs, |
62
|
0
|
|
|
|
|
|
"dll" => \$dll, |
63
|
|
|
|
|
|
|
"modversion" => \$modversion, |
64
|
|
|
|
|
|
|
"detail|d" => \$detail, |
65
|
|
|
|
|
|
|
"help|h" => sub { pod2usage({ -verbose => 2}) }, |
66
|
|
|
|
|
|
|
"version" => sub { print "App::palien version " . ($App::palien::VERSION || 'dev') . "\n"; exit 1; }, |
67
|
|
|
|
|
|
|
) || pod2usage(1); |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
unless(@ARGV) |
70
|
|
|
|
|
|
|
{ |
71
|
|
|
|
|
|
|
my %mods; |
72
|
0
|
|
|
0
|
|
|
foreach my $inc (@INC) |
73
|
0
|
|
0
|
0
|
|
|
{ |
|
0
|
|
|
|
|
|
|
74
|
0
|
0
|
|
|
|
|
my $dir = path( "$inc/Alien" ); |
75
|
|
|
|
|
|
|
next unless -d $dir; |
76
|
0
|
0
|
|
|
|
|
foreach my $pm (grep /\.pm$/, map { $_->basename } grep { -f $_ } $dir->children) |
77
|
|
|
|
|
|
|
{ |
78
|
0
|
|
|
|
|
|
$pm =~ s/\.pm$//; |
79
|
0
|
|
|
|
|
|
next if $pm =~ /^(Base|Packages|Builder|MSYS)$/; |
80
|
|
|
|
|
|
|
print "$pm = $pm\n"; |
81
|
0
|
|
|
|
|
|
$mods{"Alien::$pm"} = 1; |
82
|
0
|
0
|
|
|
|
|
} |
83
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
my $share_root = path("$inc/auto/share/dist"); |
85
|
0
|
|
|
|
|
|
next unless -d $share_root; |
86
|
0
|
0
|
|
|
|
|
foreach my $share (sort { $a->basename cmp $b->basename } $share_root->children) |
87
|
0
|
|
|
|
|
|
{ |
88
|
0
|
|
|
|
|
|
my $readme = $share->child('README'); |
89
|
|
|
|
|
|
|
next unless (-r $readme) && ($readme->slurp =~ /This README file is autogenerated by Alien::Base/); |
90
|
|
|
|
|
|
|
my $module = $share->basename; |
91
|
0
|
|
|
|
|
|
$module =~ s/-/::/g; |
92
|
0
|
0
|
|
|
|
|
$mods{$module} = 1; |
93
|
0
|
|
|
|
|
|
} |
|
0
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
|
95
|
0
|
|
|
|
|
|
} |
96
|
0
|
0
|
0
|
|
|
|
|
97
|
0
|
|
|
|
|
|
@ARGV = sort keys %mods; |
98
|
0
|
|
|
|
|
|
} |
99
|
0
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
foreach my $module (@ARGV) |
101
|
|
|
|
|
|
|
{ |
102
|
|
|
|
|
|
|
my $alien; |
103
|
|
|
|
|
|
|
|
104
|
0
|
|
|
|
|
|
if($module =~ /::/) |
105
|
|
|
|
|
|
|
{ |
106
|
|
|
|
|
|
|
$alien = eval { |
107
|
0
|
|
|
|
|
|
my $pm = $module . ".pm"; |
108
|
|
|
|
|
|
|
$pm =~ s/::/\\/g; |
109
|
0
|
|
|
|
|
|
require $pm; |
110
|
|
|
|
|
|
|
$module->new; |
111
|
0
|
0
|
|
|
|
|
}; |
112
|
|
|
|
|
|
|
if($@) |
113
|
0
|
|
|
|
|
|
{ |
114
|
0
|
|
|
|
|
|
warn "unable to load $module: $@"; |
115
|
0
|
|
|
|
|
|
$status = 2; |
116
|
0
|
|
|
|
|
|
next; |
117
|
0
|
|
|
|
|
|
} |
118
|
|
|
|
|
|
|
} |
119
|
0
|
0
|
|
|
|
|
else |
120
|
|
|
|
|
|
|
{ |
121
|
0
|
|
|
|
|
|
$alien = _find($module); |
122
|
0
|
|
|
|
|
|
next unless $alien; |
123
|
0
|
|
|
|
|
|
} |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
if($detail) |
126
|
|
|
|
|
|
|
{ |
127
|
|
|
|
|
|
|
my $class = ref $alien; |
128
|
0
|
|
|
|
|
|
printf "=============================================\n"; |
129
|
0
|
0
|
|
|
|
|
printf "class: %s\n", ref $alien; |
130
|
|
|
|
|
|
|
printf "version: %s\n", _version $alien; |
131
|
|
|
|
|
|
|
printf "modversion: %s\n", _modversion $alien; |
132
|
0
|
0
|
|
|
|
|
printf "dist: %s\n", $alien->dist_dir if eval { $alien->dist_dir }; |
133
|
|
|
|
|
|
|
printf "cflags: %s\n", _cflags $alien; |
134
|
0
|
|
|
|
|
|
printf "libs: %s\n", _libs $alien; |
135
|
0
|
|
|
|
|
|
} |
136
|
0
|
|
|
|
|
|
|
137
|
0
|
|
|
|
|
|
if( defined $bin_dir) |
138
|
0
|
|
|
|
|
|
{ |
139
|
0
|
0
|
|
|
|
|
print _bin_dir ( $dir_sep, $alien) , "\n"; |
|
0
|
|
|
|
|
|
|
140
|
0
|
|
|
|
|
|
} |
141
|
0
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
if($cflags) |
143
|
|
|
|
|
|
|
{ |
144
|
0
|
0
|
|
|
|
|
print _cflags $alien, "\n"; |
145
|
|
|
|
|
|
|
} |
146
|
0
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
if($libs) |
148
|
|
|
|
|
|
|
{ |
149
|
0
|
0
|
|
|
|
|
print _libs $alien, "\n"; |
150
|
|
|
|
|
|
|
} |
151
|
0
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
if($modversion) |
153
|
|
|
|
|
|
|
{ |
154
|
0
|
0
|
|
|
|
|
print _modversion $alien, "\n"; |
155
|
|
|
|
|
|
|
} |
156
|
0
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
if($dll) |
158
|
|
|
|
|
|
|
{ |
159
|
0
|
0
|
|
|
|
|
print $_, "\n" for $alien->dynamic_libs; |
160
|
|
|
|
|
|
|
} |
161
|
0
|
|
|
|
|
|
} |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
$status; |
164
|
0
|
0
|
|
|
|
|
} |
165
|
|
|
|
|
|
|
|
166
|
0
|
|
|
|
|
|
my $byname; |
167
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
{ |
169
|
|
|
|
|
|
|
my($q) = @_; |
170
|
0
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
unless($byname) |
172
|
|
|
|
|
|
|
{ |
173
|
|
|
|
|
|
|
$byname->{libarchive} = 'Alien::Libarchive'; |
174
|
|
|
|
|
|
|
$byname->{bz2} = 'Alien::bz2'; |
175
|
|
|
|
|
|
|
foreach my $inc (@INC) |
176
|
|
|
|
|
|
|
{ |
177
|
0
|
|
|
0
|
|
|
my $share_root = path("$inc/auto/share/dist"); |
178
|
|
|
|
|
|
|
next unless -d $share_root; |
179
|
0
|
0
|
|
|
|
|
foreach my $share ($share_root->children) |
180
|
|
|
|
|
|
|
{ |
181
|
0
|
|
|
|
|
|
my $readme = $share->child('README'); |
182
|
0
|
|
|
|
|
|
next unless (-r $readme) && ($readme->slurp =~ /This README file is autogenerated by Alien::Base/); |
183
|
0
|
|
|
|
|
|
my $module = $share->basename; |
184
|
|
|
|
|
|
|
$module =~ s/-/::/g; |
185
|
0
|
|
|
|
|
|
my $name = eval { |
186
|
0
|
0
|
|
|
|
|
my $module = "$module::ConfigData"; |
187
|
0
|
|
|
|
|
|
my $pm = "$module.pm"; |
188
|
|
|
|
|
|
|
$pm =~ s/::/\\/g; |
189
|
0
|
|
|
|
|
|
require $pm; |
190
|
0
|
0
|
0
|
|
|
|
$module->config('name'); |
191
|
0
|
|
|
|
|
|
}; |
192
|
0
|
|
|
|
|
|
$byname->{$name} = $module; |
193
|
0
|
|
|
|
|
|
} |
194
|
0
|
|
|
|
|
|
} |
195
|
0
|
|
|
|
|
|
} |
196
|
0
|
|
|
|
|
|
|
197
|
0
|
|
|
|
|
|
my $module = $byname->{$q}; |
198
|
0
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
defined $module |
200
|
0
|
|
|
|
|
|
? eval { |
201
|
|
|
|
|
|
|
my $pm = "$module.pm"; |
202
|
|
|
|
|
|
|
$pm =~ s/::/\\/g; |
203
|
|
|
|
|
|
|
require $pm; |
204
|
|
|
|
|
|
|
$module->new; |
205
|
0
|
|
|
|
|
|
} || warn "unable to load $module: $@" && () |
206
|
|
|
|
|
|
|
: (); |
207
|
|
|
|
|
|
|
} |
208
|
0
|
0
|
0
|
|
|
|
|
209
|
|
|
|
|
|
|
} |
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
1; |
212
|
|
|
|
|
|
|
|
213
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
=pod |
215
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
=encoding UTF-8 |
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
=head1 NAME |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
App::palien - Command line interface to Alien::Base |
221
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
=head1 VERSION |
223
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
version 0.18 |
225
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
=head1 DESCRIPTION |
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
This module provides the machinery for the command line |
229
|
|
|
|
|
|
|
program L<palien>. |
230
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
=head1 SEE ALSO |
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
L<palien> |
234
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
=head1 AUTHOR |
236
|
|
|
|
|
|
|
|
237
|
|
|
|
|
|
|
Author: Graham Ollis E<lt>plicease@cpan.orgE<gt> |
238
|
|
|
|
|
|
|
|
239
|
|
|
|
|
|
|
Contributors: |
240
|
|
|
|
|
|
|
|
241
|
|
|
|
|
|
|
Diab Jerius (DJERIUS) |
242
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
244
|
|
|
|
|
|
|
|
245
|
|
|
|
|
|
|
This software is copyright (c) 2017-2022 by Graham Ollis. |
246
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
248
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
249
|
|
|
|
|
|
|
|
250
|
|
|
|
|
|
|
=cut |