line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CPANPLUS; |
2
|
|
|
|
|
|
|
|
3
|
20
|
|
|
20
|
|
138
|
use strict; |
|
20
|
|
|
|
|
42
|
|
|
20
|
|
|
|
|
599
|
|
4
|
20
|
|
|
20
|
|
99
|
use Carp; |
|
20
|
|
|
|
|
48
|
|
|
20
|
|
|
|
|
1144
|
|
5
|
|
|
|
|
|
|
|
6
|
20
|
|
|
20
|
|
116
|
use CPANPLUS::Error; |
|
20
|
|
|
|
|
33
|
|
|
20
|
|
|
|
|
982
|
|
7
|
20
|
|
|
20
|
|
7136
|
use CPANPLUS::Backend; |
|
20
|
|
|
|
|
81
|
|
|
20
|
|
|
|
|
848
|
|
8
|
|
|
|
|
|
|
|
9
|
20
|
|
|
20
|
|
143
|
use Locale::Maketext::Simple Class => 'CPANPLUS', Style => 'gettext'; |
|
20
|
|
|
|
|
41
|
|
|
20
|
|
|
|
|
90
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
BEGIN { |
12
|
20
|
|
|
20
|
|
5588
|
use Exporter (); |
|
20
|
|
|
|
|
46
|
|
|
20
|
|
|
|
|
502
|
|
13
|
20
|
|
|
20
|
|
102
|
use vars qw( @EXPORT @ISA $VERSION ); |
|
20
|
|
|
|
|
39
|
|
|
20
|
|
|
|
|
1459
|
|
14
|
20
|
|
|
20
|
|
106
|
@EXPORT = qw( shell fetch get install ); |
15
|
20
|
|
|
|
|
361
|
@ISA = qw( Exporter ); |
16
|
20
|
|
|
|
|
8829
|
$VERSION = "0.9910"; #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
|
37
|
my $cpan = CPANPLUS::Backend->new; |
23
|
4
|
100
|
|
|
|
20
|
my $mod = shift or ( |
24
|
|
|
|
|
|
|
error(loc("No module specified!")), return |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
|
27
|
3
|
100
|
|
|
|
9
|
if ( ref $mod ) { |
28
|
1
|
|
|
|
|
9
|
error( loc( "You passed an object. Use %1 for OO style interaction", |
29
|
|
|
|
|
|
|
'CPANPLUS::Backend' )); |
30
|
1
|
|
|
|
|
10
|
return; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
} else { |
33
|
2
|
50
|
|
|
|
5
|
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
|
|
|
|
13
|
$ok |
41
|
|
|
|
|
|
|
? msg(loc("Installing of %1 successful", $mod),1) |
42
|
|
|
|
|
|
|
: msg(loc("Installing of %1 failed", $mod),1); |
43
|
|
|
|
|
|
|
|
44
|
2
|
|
|
|
|
18
|
return $ok; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
### simply downloads a module and stores it |
49
|
|
|
|
|
|
|
sub fetch { |
50
|
8
|
|
|
8
|
1
|
105
|
my $cpan = CPANPLUS::Backend->new; |
51
|
|
|
|
|
|
|
|
52
|
8
|
100
|
|
|
|
39
|
my $mod = shift or ( |
53
|
|
|
|
|
|
|
error(loc("No module specified!")), return |
54
|
|
|
|
|
|
|
); |
55
|
|
|
|
|
|
|
|
56
|
6
|
100
|
|
|
|
16
|
if ( ref $mod ) { |
57
|
2
|
|
|
|
|
7
|
error( loc( "You passed an object. Use %1 for OO style interaction", |
58
|
|
|
|
|
|
|
'CPANPLUS::Backend' )); |
59
|
2
|
|
|
|
|
25
|
return; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
} else { |
62
|
4
|
50
|
|
|
|
12
|
my $obj = $cpan->module_tree($mod) or ( |
63
|
|
|
|
|
|
|
error(loc("No such module '%1'", $mod)), |
64
|
|
|
|
|
|
|
return |
65
|
|
|
|
|
|
|
); |
66
|
|
|
|
|
|
|
|
67
|
4
|
|
|
|
|
19
|
my $ok = $obj->fetch( fetchdir => '.' ); |
68
|
|
|
|
|
|
|
|
69
|
4
|
100
|
|
|
|
28
|
$ok |
70
|
|
|
|
|
|
|
? msg(loc("Fetching of %1 successful", $mod),1) |
71
|
|
|
|
|
|
|
: msg(loc("Fetching of %1 failed", $mod),1); |
72
|
|
|
|
|
|
|
|
73
|
4
|
|
|
|
|
43
|
return $ok; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
### alias to fetch() due to compatibility with cpan.pm ### |
78
|
4
|
|
|
4
|
1
|
36
|
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
|
1034
|
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
|
|
|
|
|
852
|
|
|
1
|
|
|
|
|
8
|
|
90
|
1
|
50
|
|
|
|
5
|
die $@ if $@; |
91
|
|
|
|
|
|
|
|
92
|
1
|
|
|
|
|
15
|
my $cpan = CPANPLUS::Shell->new(); |
93
|
|
|
|
|
|
|
|
94
|
1
|
|
|
|
|
8
|
$cpan->shell(); |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
1; |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
__END__ |