← Index
NYTProf Performance Profile   « line view »
For Makefile.PL
  Run on Sun Mar 1 16:04:44 2015
Reported on Sun Mar 1 16:09:02 2015

FilenameC:/tmp64ng/perl/vendor/lib/Portable/CPAN.pm
StatementsExecuted 60 statements in 0s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1110s0sPortable::CPAN::::BEGIN@3Portable::CPAN::BEGIN@3
1110s0sPortable::CPAN::::BEGIN@4Portable::CPAN::BEGIN@4
1110s0sPortable::CPAN::::BEGIN@5Portable::CPAN::BEGIN@5
1110s0sPortable::CPAN::::BEGIN@6Portable::CPAN::BEGIN@6
2210s0sPortable::CPAN::::CORE:sortPortable::CPAN::CORE:sort (opcode)
1110s0sPortable::CPAN::::CORE:substPortable::CPAN::CORE:subst (opcode)
0000s0sPortable::CPAN::::applyPortable::CPAN::apply
1110s0sPortable::CPAN::::newPortable::CPAN::new
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Portable::CPAN;
2
320s10s
# spent 0s within Portable::CPAN::BEGIN@3 which was called: # once (0s+0s) by Portable::new at line 3
use 5.008;
# spent 0s making 1 call to Portable::CPAN::BEGIN@3
420s20s
# spent 0s within Portable::CPAN::BEGIN@4 which was called: # once (0s+0s) by Portable::new at line 4
use strict;
# spent 0s making 1 call to Portable::CPAN::BEGIN@4 # spent 0s making 1 call to strict::import
520s20s
# spent 0s within Portable::CPAN::BEGIN@5 which was called: # once (0s+0s) by Portable::new at line 5
use warnings;
# spent 0s making 1 call to Portable::CPAN::BEGIN@5 # spent 0s making 1 call to warnings::import
620s10s
# spent 0s within Portable::CPAN::BEGIN@6 which was called: # once (0s+0s) by Portable::new at line 6
use Portable::FileSpec;
# spent 0s making 1 call to Portable::CPAN::BEGIN@6
7
810sour $VERSION = '1.22';
9
10# Create the enumerations
1110sour %bin = map { $_ => 1 } qw{
12 bzip2 curl ftp gpg gzip lynx
13 ncftp ncftpget pager patch
14 shell tar unzip wget
15};
1610sour %post = map { $_ => 1 } qw{
17 make_arg make_install_arg makepl_arg
18 mbuild_arg mbuild_install_arg mbuildpl_arg
19};
2010sour %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
sub new {
3010s my $class = shift;
3110s my $parent = shift;
3210s20s 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
3710s my $self = bless { }, $class;
38
39 # Map the
4010s10s my $cpan = $parent->portable_cpan;
# spent 0s making 1 call to Portable::portable_cpan
4110s10s my $root = $parent->dist_root;
# spent 0s making 1 call to Portable::dist_root
4210s10s foreach my $key ( sort keys %$cpan ) {
# spent 0s making 1 call to Portable::CPAN::CORE:sort
43100s unless (
44 defined $cpan->{$key}
45 and
46 length $cpan->{$key}
47 and not
48 $post{$key}
49 ) {
5020s $self->{$key} = $cpan->{$key};
5120s next;
52 }
5380s if ($file{$key}) {
5420s20s $self->{$key} = Portable::FileSpec::catfile($root, split /\//, $cpan->{$key});
# spent 0s making 2 calls to Portable::FileSpec::catfile, avg 0s/call
55 }
56 else {
5760s60s $self->{$key} = Portable::FileSpec::catdir($root, split /\//, $cpan->{$key});
# spent 0s making 6 calls to Portable::FileSpec::catdir, avg 0s/call
58 }
59 }
6010s10s my $config = $parent->config;
# spent 0s making 1 call to Portable::config
6110s10s foreach my $key ( sort keys %post ) {
# spent 0s making 1 call to Portable::CPAN::CORE:sort
6260s next unless defined $self->{$key};
6310s10s $self->{$key} =~ s/\$(\w+)/$config->{$1}/g;
# spent 0s making 1 call to Portable::CPAN::CORE:subst
64 }
65
6610s return $self;
67}
68
69sub 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
9410s1;
 
# spent 0s within Portable::CPAN::CORE:sort which was called 2 times, avg 0s/call: # once (0s+0s) by Portable::CPAN::new at line 42 # once (0s+0s) by Portable::CPAN::new at line 61
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
sub Portable::CPAN::CORE:subst; # opcode