ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/Perl-LibExtractor/LibExtractor.pm
(Generate patch)

Comparing cvsroot/Perl-LibExtractor/LibExtractor.pm (file contents):
Revision 1.24 by root, Sun Feb 5 21:44:46 2012 UTC vs.
Revision 1.25 by root, Mon Sep 23 07:57:55 2013 UTC

34package Perl::LibExtractor; 34package Perl::LibExtractor;
35 35
36our $VERSION = '1.1'; 36our $VERSION = '1.1';
37 37
38use Config; 38use Config;
39use Cwd ();
39use File::Spec (); 40use File::Spec ();
40use File::Temp (); 41use File::Temp ();
41 42
42use common::sense; 43use common::sense;
43 44
75 76
76The following key-value pairs exist, with default values as specified. 77The following key-value pairs exist, with default values as specified.
77 78
78=over 4 79=over 4
79 80
80=item inc => \@INC without "." 81=item inc => \@INC without any initial "."
81 82
82An arrayref with paths to perl library directories. The default is 83An arrayref with paths to perl library directories. The default is
83C<\@INC>, with F<.> removed. 84C<\@INC>, with the first entry removed if it is F<.>. Internally, all
85paths will be changed to absolute paths.
84 86
85To prepend custom dirs just do this: 87To prepend custom dirs just do this:
86 88
87 inc => ["mydir", @INC], 89 inc => ["mydir", @INC],
88 90
125 127
126sub new { 128sub new {
127 my ($class, %kv) = @_; 129 my ($class, %kv) = @_;
128 130
129 my $self = bless { 131 my $self = bless {
130 inc => [grep $_ ne ".", @INC],
131 use_packlist => 1, 132 use_packlist => 1,
132 extra_deps => $EXTRA_DEPS, 133 extra_deps => $EXTRA_DEPS,
133 %kv, 134 %kv,
134 set => {}, 135 set => {},
135 }, $class; 136 }, $class;
136 137
138 unless (exists $self->{inc}) {
139 my @inc = @INC;
140 shift @inc if $inc[0] eq ".";
141 $self->{inc} = \@INC;
142 }
143
137 my %inc_seen; 144 my %inc_seen;
138 my @inc = grep !$inc_seen{$_}++ && -d "$_/.", @{ $self->{inc} }; 145 my @inc = grep !$inc_seen{$_}++ && -d "$_/.", map Cwd::abs_path ($_), @{ $self->{inc} };
139 $self->{inc} = \@inc; 146 $self->{inc} = \@inc;
140 147
141 # maybe not inc, but these? 148 # maybe not inc, but these?
142 # sitearchexp 149 # sitearchexp
143 # sitelib 150 # sitelib

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines