Filename | C:/tmp64ng/perl/vendor/lib/Portable/CPAN.pm |
Statements | Executed 60 statements in 0s |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 0s | 0s | BEGIN@3 | Portable::CPAN::
1 | 1 | 1 | 0s | 0s | BEGIN@4 | Portable::CPAN::
1 | 1 | 1 | 0s | 0s | BEGIN@5 | Portable::CPAN::
1 | 1 | 1 | 0s | 0s | BEGIN@6 | Portable::CPAN::
2 | 2 | 1 | 0s | 0s | CORE:sort (opcode) | Portable::CPAN::
1 | 1 | 1 | 0s | 0s | CORE:subst (opcode) | Portable::CPAN::
0 | 0 | 0 | 0s | 0s | apply | Portable::CPAN::
1 | 1 | 1 | 0s | 0s | new | Portable::CPAN::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Portable::CPAN; | ||||
2 | |||||
3 | 2 | 0s | 1 | 0s | # spent 0s within Portable::CPAN::BEGIN@3 which was called:
# once (0s+0s) by Portable::new at line 3 # spent 0s making 1 call to Portable::CPAN::BEGIN@3 |
4 | 2 | 0s | 2 | 0s | # spent 0s within Portable::CPAN::BEGIN@4 which was called:
# once (0s+0s) by Portable::new at line 4 # spent 0s making 1 call to Portable::CPAN::BEGIN@4
# spent 0s making 1 call to strict::import |
5 | 2 | 0s | 2 | 0s | # spent 0s within Portable::CPAN::BEGIN@5 which was called:
# once (0s+0s) by Portable::new at line 5 # spent 0s making 1 call to Portable::CPAN::BEGIN@5
# spent 0s making 1 call to warnings::import |
6 | 2 | 0s | 1 | 0s | # spent 0s within Portable::CPAN::BEGIN@6 which was called:
# once (0s+0s) by Portable::new at line 6 # spent 0s making 1 call to Portable::CPAN::BEGIN@6 |
7 | |||||
8 | 1 | 0s | our $VERSION = '1.22'; | ||
9 | |||||
10 | # Create the enumerations | ||||
11 | 1 | 0s | our %bin = map { $_ => 1 } qw{ | ||
12 | bzip2 curl ftp gpg gzip lynx | ||||
13 | ncftp ncftpget pager patch | ||||
14 | shell tar unzip wget | ||||
15 | }; | ||||
16 | 1 | 0s | our %post = map { $_ => 1 } qw{ | ||
17 | make_arg make_install_arg makepl_arg | ||||
18 | mbuild_arg mbuild_install_arg mbuildpl_arg | ||||
19 | }; | ||||
20 | 1 | 0s | our %file = ( %bin, histfile => 1 ); | ||
21 | |||||
- - | |||||
26 | ##################################################################### | ||||
27 | # Constructor | ||||
28 | |||||
29 | # spent 0s within Portable::CPAN::new which was called:
# once (0s+0s) by Portable::new at line 158 of Portable.pm | ||||
30 | 1 | 0s | my $class = shift; | ||
31 | 1 | 0s | my $parent = shift; | ||
32 | 1 | 0s | 2 | 0s | unless ( Portable::_HASH($parent->portable_cpan) ) { # spent 0s making 1 call to Portable::_HASH
# spent 0s making 1 call to Portable::portable_cpan |
33 | die('Missing or invalid cpan key in portable.perl'); | ||||
34 | } | ||||
35 | |||||
36 | # Create the object | ||||
37 | 1 | 0s | my $self = bless { }, $class; | ||
38 | |||||
39 | # Map the | ||||
40 | 1 | 0s | 1 | 0s | my $cpan = $parent->portable_cpan; # spent 0s making 1 call to Portable::portable_cpan |
41 | 1 | 0s | 1 | 0s | my $root = $parent->dist_root; # spent 0s making 1 call to Portable::dist_root |
42 | 1 | 0s | 1 | 0s | foreach my $key ( sort keys %$cpan ) { # spent 0s making 1 call to Portable::CPAN::CORE:sort |
43 | 10 | 0s | unless ( | ||
44 | defined $cpan->{$key} | ||||
45 | and | ||||
46 | length $cpan->{$key} | ||||
47 | and not | ||||
48 | $post{$key} | ||||
49 | ) { | ||||
50 | 2 | 0s | $self->{$key} = $cpan->{$key}; | ||
51 | 2 | 0s | next; | ||
52 | } | ||||
53 | 8 | 0s | if ($file{$key}) { | ||
54 | 2 | 0s | 2 | 0s | $self->{$key} = Portable::FileSpec::catfile($root, split /\//, $cpan->{$key}); # spent 0s making 2 calls to Portable::FileSpec::catfile, avg 0s/call |
55 | } | ||||
56 | else { | ||||
57 | 6 | 0s | 6 | 0s | $self->{$key} = Portable::FileSpec::catdir($root, split /\//, $cpan->{$key}); # spent 0s making 6 calls to Portable::FileSpec::catdir, avg 0s/call |
58 | } | ||||
59 | } | ||||
60 | 1 | 0s | 1 | 0s | my $config = $parent->config; # spent 0s making 1 call to Portable::config |
61 | 1 | 0s | 1 | 0s | foreach my $key ( sort keys %post ) { # spent 0s making 1 call to Portable::CPAN::CORE:sort |
62 | 6 | 0s | next unless defined $self->{$key}; | ||
63 | 1 | 0s | 1 | 0s | $self->{$key} =~ s/\$(\w+)/$config->{$1}/g; # spent 0s making 1 call to Portable::CPAN::CORE:subst |
64 | } | ||||
65 | |||||
66 | 1 | 0s | return $self; | ||
67 | } | ||||
68 | |||||
69 | sub apply { | ||||
70 | my $self = shift; | ||||
71 | my $parent = shift; | ||||
72 | |||||
73 | # Load the CPAN configuration | ||||
74 | require CPAN::Config; | ||||
75 | |||||
76 | # Overwrite the CPAN config entries | ||||
77 | foreach my $key ( sort keys %$self ) { | ||||
78 | $CPAN::Config->{$key} = $self->{$key}; | ||||
79 | } | ||||
80 | |||||
81 | # Confirm we got all the paths | ||||
82 | my $volume = quotemeta $parent->dist_volume; | ||||
83 | foreach my $key ( sort keys %$CPAN::Config ) { | ||||
84 | next unless defined $CPAN::Config->{$key}; | ||||
85 | next if $CPAN::Config->{$key} =~ /$volume/; | ||||
86 | next unless $CPAN::Config->{$key} =~ /\b[a-z]\:/i; | ||||
87 | next if -e $CPAN::Config->{$key}; | ||||
88 | die "Failed to localize \$CPAN::Config->{$key} ($CPAN::Config->{$key})"; | ||||
89 | } | ||||
90 | |||||
91 | return 1; | ||||
92 | } | ||||
93 | |||||
94 | 1 | 0s | 1; | ||
sub Portable::CPAN::CORE:sort; # opcode | |||||
# spent 0s within Portable::CPAN::CORE:subst which was called:
# once (0s+0s) by Portable::CPAN::new at line 63 |