line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CPANPLUS; |
2
|
|
|
|
|
|
|
|
3
|
20
|
|
|
20
|
|
143
|
use strict; |
|
20
|
|
|
|
|
51
|
|
|
20
|
|
|
|
|
692
|
|
4
|
20
|
|
|
20
|
|
114
|
use Carp; |
|
20
|
|
|
|
|
41
|
|
|
20
|
|
|
|
|
1218
|
|
5
|
|
|
|
|
|
|
|
6
|
20
|
|
|
20
|
|
126
|
use CPANPLUS::Error; |
|
20
|
|
|
|
|
55
|
|
|
20
|
|
|
|
|
1198
|
|
7
|
20
|
|
|
20
|
|
6934
|
use CPANPLUS::Backend; |
|
20
|
|
|
|
|
70
|
|
|
20
|
|
|
|
|
881
|
|
8
|
|
|
|
|
|
|
|
9
|
20
|
|
|
20
|
|
161
|
use Locale::Maketext::Simple Class => 'CPANPLUS', Style => 'gettext'; |
|
20
|
|
|
|
|
41
|
|
|
20
|
|
|
|
|
137
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
BEGIN { |
12
|
20
|
|
|
20
|
|
5496
|
use Exporter (); |
|
20
|
|
|
|
|
46
|
|
|
20
|
|
|
|
|
467
|
|
13
|
20
|
|
|
20
|
|
101
|
use vars qw( @EXPORT @ISA $VERSION ); |
|
20
|
|
|
|
|
39
|
|
|
20
|
|
|
|
|
1656
|
|
14
|
20
|
|
|
20
|
|
96
|
@EXPORT = qw( shell fetch get install ); |
15
|
20
|
|
|
|
|
364
|
@ISA = qw( Exporter ); |
16
|
20
|
|
|
|
|
9112
|
$VERSION = "0.9914"; #have to hardcode or cpan.org gets unhappy |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
### purely for backward compatibility, so we can call it from the commandline: |
20
|
|
|
|
|
|
|
### perl -MCPANPLUS -e 'install Net::SMTP' |
21
|
|
|
|
|
|
|
sub install { |
22
|
4
|
|
|
4
|
1
|
38
|
my $cpan = CPANPLUS::Backend->new; |
23
|
4
|
100
|
|
|
|
30
|
my $mod = shift or ( |
24
|
|
|
|
|
|
|
error(loc("No module specified!")), return |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
|
27
|
3
|
100
|
|
|
|
17
|
if ( ref $mod ) { |
28
|
1
|
|
|
|
|
4
|
error( loc( "You passed an object. Use %1 for OO style interaction", |
29
|
|
|
|
|
|
|
'CPANPLUS::Backend' )); |
30
|
1
|
|
|
|
|
12
|
return; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
} else { |
33
|
2
|
50
|
|
|
|
10
|
my $obj = $cpan->module_tree($mod) or ( |
34
|
|
|
|
|
|
|
error(loc("No such module '%1'", $mod)), |
35
|
|
|
|
|
|
|
return |
36
|
|
|
|
|
|
|
); |
37
|
|
|
|
|
|
|
|
38
|
2
|
|
|
|
|
7
|
my $ok = $obj->install; |
39
|
|
|
|
|
|
|
|
40
|
2
|
100
|
|
|
|
14
|
$ok |
41
|
|
|
|
|
|
|
? msg(loc("Installing of %1 successful", $mod),1) |
42
|
|
|
|
|
|
|
: msg(loc("Installing of %1 failed", $mod),1); |
43
|
|
|
|
|
|
|
|
44
|
2
|
|
|
|
|
28
|
return $ok; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
### simply downloads a module and stores it |
49
|
|
|
|
|
|
|
sub fetch { |
50
|
8
|
|
|
8
|
1
|
120
|
my $cpan = CPANPLUS::Backend->new; |
51
|
|
|
|
|
|
|
|
52
|
8
|
100
|
|
|
|
42
|
my $mod = shift or ( |
53
|
|
|
|
|
|
|
error(loc("No module specified!")), return |
54
|
|
|
|
|
|
|
); |
55
|
|
|
|
|
|
|
|
56
|
6
|
100
|
|
|
|
23
|
if ( ref $mod ) { |
57
|
2
|
|
|
|
|
10
|
error( loc( "You passed an object. Use %1 for OO style interaction", |
58
|
|
|
|
|
|
|
'CPANPLUS::Backend' )); |
59
|
2
|
|
|
|
|
23
|
return; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
} else { |
62
|
4
|
50
|
|
|
|
13
|
my $obj = $cpan->module_tree($mod) or ( |
63
|
|
|
|
|
|
|
error(loc("No such module '%1'", $mod)), |
64
|
|
|
|
|
|
|
return |
65
|
|
|
|
|
|
|
); |
66
|
|
|
|
|
|
|
|
67
|
4
|
|
|
|
|
23
|
my $ok = $obj->fetch( fetchdir => '.' ); |
68
|
|
|
|
|
|
|
|
69
|
4
|
100
|
|
|
|
33
|
$ok |
70
|
|
|
|
|
|
|
? msg(loc("Fetching of %1 successful", $mod),1) |
71
|
|
|
|
|
|
|
: msg(loc("Fetching of %1 failed", $mod),1); |
72
|
|
|
|
|
|
|
|
73
|
4
|
|
|
|
|
51
|
return $ok; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
### alias to fetch() due to compatibility with cpan.pm ### |
78
|
4
|
|
|
4
|
1
|
35
|
sub get { fetch(@_) } |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
### purely for backwards compatibility, so we can call it from the commandline: |
82
|
|
|
|
|
|
|
### perl -MCPANPLUS -e 'shell' |
83
|
|
|
|
|
|
|
sub shell { |
84
|
1
|
|
|
1
|
1
|
1253
|
my $option = shift; |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
### since the user can specify the type of shell they wish to start |
87
|
|
|
|
|
|
|
### when they call the shell() function, we have to eval the usage |
88
|
|
|
|
|
|
|
### of CPANPLUS::Shell so we can set up all the checks properly |
89
|
1
|
|
|
|
|
2
|
eval { require CPANPLUS::Shell; CPANPLUS::Shell->import($option) }; |
|
1
|
|
|
|
|
853
|
|
|
1
|
|
|
|
|
8
|
|
90
|
1
|
50
|
|
|
|
6
|
die $@ if $@; |
91
|
|
|
|
|
|
|
|
92
|
1
|
|
|
|
|
17
|
my $cpan = CPANPLUS::Shell->new(); |
93
|
|
|
|
|
|
|
|
94
|
1
|
|
|
|
|
10
|
$cpan->shell(); |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
1; |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
__END__ |