| … | |
… | |
| 118 | #$pack->called_for( $obj->id ); |
118 | #$pack->called_for( $obj->id ); |
| 119 | # Initiate a perl Makefile.PL process - necessary to generate the deps |
119 | # Initiate a perl Makefile.PL process - necessary to generate the deps |
| 120 | $pack->make; |
120 | $pack->make; |
| 121 | $pack->unforce if $pack->can("unforce") && exists $obj->{'force_update'}; |
121 | $pack->unforce if $pack->can("unforce") && exists $obj->{'force_update'}; |
| 122 | delete $obj->{'force_update'}; |
122 | delete $obj->{'force_update'}; |
| 123 | my $tmp_dir = -d $ENV{TMPDIR} ? defined( $ENV{TMPDIR} ) : $ENV{HOME}; |
|
|
| 124 | $tmp_dir = $pack->{build_dir}; |
123 | my $tmp_dir = $pack->{build_dir}; |
|
|
124 | # While we're at it, get the ${S} dir for the ebuld ;) |
|
|
125 | $self->{'cpan'}{lc($module_name)}{'portage_sdir'} = $pack->{build_dir}; |
|
|
126 | $self->{'cpan'}{lc($module_name)}{'portage_sdir'} =~ s{.*/}{}xmsg; |
| 125 | FindDeps( $self, $tmp_dir, $module_name ); |
127 | FindDeps( $self, $tmp_dir, $module_name ); |
| 126 | |
128 | |
| 127 | # Most modules don't list module-build as a dep - so we force it if there |
129 | # Most modules don't list module-build as a dep - so we force it if there |
| 128 | # is a Build.PL file |
130 | # is a Build.PL file |
| 129 | if ( -f "Build.PL" ) { |
131 | if ( -f "Build.PL" ) { |
| … | |
… | |
| 172 | foreach my $type qw(requires build_requires recommends) { |
174 | foreach my $type qw(requires build_requires recommends) { |
| 173 | if ( my $ar_type = $arr->{$type} ) { |
175 | if ( my $ar_type = $arr->{$type} ) { |
| 174 | foreach my $module ( keys %{$ar_type} ) { |
176 | foreach my $module ( keys %{$ar_type} ) { |
| 175 | next if ( $module eq "" ); |
177 | next if ( $module eq "" ); |
| 176 | next if ( $module =~ /Cwd/i ); |
178 | next if ( $module =~ /Cwd/i ); |
|
|
179 | next if (lc($module) eq "perl"); |
| 177 | next unless ($module); |
180 | next unless ($module); |
| 178 | $self->{'cpan'}{ lc($module_name) } |
181 | $self->{'cpan'}{ lc($module_name) } |
| 179 | {'depends'}{ $module } = $ar_type->{$module}; |
182 | {'depends'}{ $module } = $ar_type->{$module}; |
| 180 | } |
183 | } |
| 181 | } |
184 | } |
| … | |
… | |
| 201 | \s{0,}PREREQ_PM\s+=>\s+(.+) |
204 | \s{0,}PREREQ_PM\s+=>\s+(.+) |
| 202 | }x; |
205 | }x; |
| 203 | next unless $p; |
206 | next unless $p; |
| 204 | while ( $p =~ m/(?:\s)([\w\:]+)=>q\[(.*?)\],?/g ) { |
207 | while ( $p =~ m/(?:\s)([\w\:]+)=>q\[(.*?)\],?/g ) { |
| 205 | my $module = $1; |
208 | my $module = $1; |
|
|
209 | next if ( $module eq "" ); |
|
|
210 | next if ( $module =~ /Cwd/i ); |
|
|
211 | next if (lc($module) eq "perl"); |
|
|
212 | next unless ($module); |
| 206 | my $version = $2; |
213 | my $version = $2; |
| 207 | $self->{'cpan'}{ lc($module_name) } |
214 | $self->{'cpan'}{ lc($module_name) } |
| 208 | {'depends'}{ $module } = $version; |
215 | {'depends'}{ $module } = $version; |
| 209 | } |
216 | } |
| 210 | |
217 | |
| … | |
… | |
| 226 | foreach my $type qw(requires recommends build_requires) { |
233 | foreach my $type qw(requires recommends build_requires) { |
| 227 | if ( $fh = FileHandle->new("<$makefile\0") ) { |
234 | if ( $fh = FileHandle->new("<$makefile\0") ) { |
| 228 | local ($/) = ""; |
235 | local ($/) = ""; |
| 229 | while (<$fh>) { |
236 | while (<$fh>) { |
| 230 | chomp; |
237 | chomp; |
| 231 | my ($p) = m/^\s+$type\s+=>\s+\{(.*?)\}/smx; |
238 | my ($p) = m/^\s+$type\s+=>\s+\{(.*?)(?:\#.*)?\}/smx; |
| 232 | next unless $p; |
239 | next unless $p; |
| 233 | undef($/); |
240 | undef($/); |
| 234 | |
241 | |
| 235 | #local($/) = "\n"; |
242 | #local($/) = "\n"; |
| 236 | my @list = split( ',', $p ); |
243 | my @list = split( ',', $p ); |
| 237 | foreach my $pa (@list) { |
244 | foreach my $pa (@list) { |
| 238 | $pa =~ s/\n|\s+|\'//mg; |
245 | $pa =~ s/\n|\s+|\'//mg; |
| 239 | if ($pa) { |
246 | if ($pa) { |
| 240 | my ( $module, $vers ) = split( /=>/, $pa ); |
247 | my ( $module, $vers ) = split( /=>/, $pa ); |
|
|
248 | next if ( $module eq "" ); |
|
|
249 | next if ( $module =~ /Cwd/i ); |
|
|
250 | next if (lc($module) eq "perl"); |
|
|
251 | next unless ($module); |
| 241 | $self->{'cpan'}{ lc($module_name) } |
252 | $self->{'cpan'}{ lc($module_name) } |
| 242 | {'depends'}{ $module } = $vers; |
253 | {'depends'}{ $module } = $vers; |
| 243 | } |
254 | } |
| 244 | } |
255 | } |
| 245 | last; |
256 | last; |
| … | |
… | |
| 282 | return unless ($filename); |
293 | return unless ($filename); |
| 283 | unless ($filename) { print STDERR "$name yielded $filename\n"; sleep(4); } |
294 | unless ($filename) { print STDERR "$name yielded $filename\n"; sleep(4); } |
| 284 | $filename =~ tr/A-Za-z0-9\./-/c; |
295 | $filename =~ tr/A-Za-z0-9\./-/c; |
| 285 | $filename =~ s/\.pm//; # e.g. CGI.pm |
296 | $filename =~ s/\.pm//; # e.g. CGI.pm |
| 286 | |
297 | |
| 287 | # We don't want to try and handle the package perl itself |
|
|
| 288 | return if ( $filename eq "perl" ); |
|
|
| 289 | |
|
|
| 290 | # Remove double .'s - happens on occasion with odd packages |
298 | # Remove double .'s - happens on occasion with odd packages |
| 291 | $filenamever =~ s/\.$//; |
299 | $filenamever =~ s/\.$//; |
| 292 | |
300 | |
| 293 | # Remove leading v's - happens on occasion |
301 | # Remove leading v's - happens on occasion |
| 294 | $filenamever =~ s{^v}{}i; |
302 | $filenamever =~ s{^v}{}i; |
| … | |
… | |
| 321 | # remove underscores |
329 | # remove underscores |
| 322 | return unless ($filename); |
330 | return unless ($filename); |
| 323 | unless ($filename) { print STDERR "$name yielded $filename\n"; sleep(4); } |
331 | unless ($filename) { print STDERR "$name yielded $filename\n"; sleep(4); } |
| 324 | $filename =~ tr/A-Za-z0-9\./-/c; |
332 | $filename =~ tr/A-Za-z0-9\./-/c; |
| 325 | $filename =~ s/\.pm//; # e.g. CGI.pm |
333 | $filename =~ s/\.pm//; # e.g. CGI.pm |
| 326 | |
|
|
| 327 | # We don't want to try and handle the package perl itself |
|
|
| 328 | return if ( $filename eq "perl" ); |
|
|
| 329 | |
334 | |
| 330 | # Remove double .'s - happens on occasion with odd packages |
335 | # Remove double .'s - happens on occasion with odd packages |
| 331 | $filenamever =~ s/\.$//; |
336 | $filenamever =~ s/\.$//; |
| 332 | |
337 | |
| 333 | # Remove leading v's - happens on occasion |
338 | # Remove leading v's - happens on occasion |