line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package PPM::Make::CPAN; |
2
|
1
|
|
|
1
|
|
826
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
3
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
19
|
|
4
|
1
|
|
|
1
|
|
24
|
use PPM::Make; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
use PPM::Make::Config qw(HAS_PPM); |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.9904'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new { |
10
|
|
|
|
|
|
|
my ($class, %opts) = @_; |
11
|
|
|
|
|
|
|
my $self = {cpan_meta => $opts{cpan_meta}, |
12
|
|
|
|
|
|
|
opts => \%opts}; |
13
|
|
|
|
|
|
|
bless $self, $class; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub make_ppm_install { |
17
|
|
|
|
|
|
|
my $self = shift; |
18
|
|
|
|
|
|
|
my %opts = %{$self->{opts}}; |
19
|
|
|
|
|
|
|
for (qw(cfg)) { |
20
|
|
|
|
|
|
|
my $given = 'no-' . $_; |
21
|
|
|
|
|
|
|
next unless $opts{$given}; |
22
|
|
|
|
|
|
|
my $passed = 'no_' . $_; |
23
|
|
|
|
|
|
|
$opts{$passed} = delete $opts{$given}; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
my %args; |
26
|
|
|
|
|
|
|
for (qw(area force nodeps)) { |
27
|
|
|
|
|
|
|
$args{$_} = delete $opts{$_}; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
my $ppm = PPM::Make->new(%opts, cpan_meta => $self->{cpan_meta}); |
31
|
|
|
|
|
|
|
$ppm->make_ppm(); |
32
|
|
|
|
|
|
|
my $ppd = $ppm->{ppd}; |
33
|
|
|
|
|
|
|
my @args = ('ppm', 'install', $ppd); |
34
|
|
|
|
|
|
|
if (HAS_PPM >= 3) { |
35
|
|
|
|
|
|
|
for my $bool_arg (qw(force nodeps)) { |
36
|
|
|
|
|
|
|
next unless defined $args{$bool_arg}; |
37
|
|
|
|
|
|
|
push @args, "--$bool_arg"; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
for my $str_arg (qw(area)) { |
40
|
|
|
|
|
|
|
next unless defined $args{$str_arg}; |
41
|
|
|
|
|
|
|
push @args, "--$str_arg", $args{$str_arg}; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
print "@args\n"; |
45
|
|
|
|
|
|
|
system(@args); |
46
|
|
|
|
|
|
|
return $?; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# placeholder for future CPAN.pm |
50
|
|
|
|
|
|
|
#sub check_prereqs { |
51
|
|
|
|
|
|
|
# my ($self, @prereqs) = @_; |
52
|
|
|
|
|
|
|
# my $cpan_meta = $self->{cpan_meta}; |
53
|
|
|
|
|
|
|
# foreach (@prereqs) { |
54
|
|
|
|
|
|
|
# my $id = $cpan_meta->instance('CPAN::Module', $_->[0]); |
55
|
|
|
|
|
|
|
# warn "********$_->[0]********", $id->as_string, "*********\n"; |
56
|
|
|
|
|
|
|
# } |
57
|
|
|
|
|
|
|
# return @prereqs; |
58
|
|
|
|
|
|
|
#} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
1; |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
__END__ |