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