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.3 by root, Sat Jan 14 21:14:36 2012 UTC vs.
Revision 1.4 by root, Sat Jan 14 21:38:34 2012 UTC

113 %kv, 113 %kv,
114 set => {}, 114 set => {},
115 }, $class; 115 }, $class;
116 116
117 my %inc_seen; 117 my %inc_seen;
118 my @inc = grep !$inc_seen{$_}++, @{ $self->{inc} }; 118 my @inc = grep !$inc_seen{$_}++ && -d "$_/.", @{ $self->{inc} };
119 $self->{inc} = \@inc; 119 $self->{inc} = \@inc;
120 120
121 $self->_set_inc; 121 $self->_set_inc;
122 122
123 $self 123 $self
124}
125
126sub _perl_path() {
127 my $secure_perl_path = $Config{perlpath};
128
129 if ($^O ne 'VMS') {
130 $secure_perl_path .= $Config{_exe}
131 unless $secure_perl_path =~ m/$Config{_exe}$/i;
132 }
133
134 $secure_perl_path
124} 135}
125 136
126sub _set_inc { 137sub _set_inc {
127 my ($self) = @_; 138 my ($self) = @_;
128 139
304 . 'open STDERR, ">stderr";' # suppress "syntax OK" message from perl 315 . 'open STDERR, ">stderr";' # suppress "syntax OK" message from perl
305 . "}\n" 316 . "}\n"
306 . (delete $self->{trace_check}); 317 . (delete $self->{trace_check});
307 close $fh; 318 close $fh;
308 319
309 my $secure_perl_path = $Config{perlpath};
310
311 if ($^O ne 'VMS') {
312 $secure_perl_path .= $Config{_exe}
313 unless $secure_perl_path =~ m/$Config{_exe}$/i;
314 }
315
316 system $secure_perl_path, "-c", "$dir/eval" 320 system _perl_path, "-c", "$dir/eval"
317 and croak "trace failure, check trace process output - caught"; 321 and croak "trace failure, check trace process output - caught";
318 322
319 my @inc = split /\x00/, do { 323 my @inc = split /\x00/, do {
320 open my $fh, "<:perlio", "$dir/out" 324 open my $fh, "<:perlio", "$dir/out"
321 or croak "$dir/out: $!"; 325 or croak "$dir/out: $!";
419=item $extractor->add_perl 423=item $extractor->add_perl
420 424
421Adds the perl binary itself to the file set, including the libperl dll, if 425Adds the perl binary itself to the file set, including the libperl dll, if
422needed. 426needed.
423 427
424#TODO# 428=cut
429
430sub add_perl {
431 my ($self) = @_;
432
433 $self->{set}{"$self->{bindir}/perl$Config{_exe}"} = [_perl_path];
434
435 # on debian, we have the special case of a perl binary linked against
436 # a static libperl.a (which is not available), but the Config says to use
437 # a shared library, which is in the wrong directory, too (which breaks
438 # every other perl installation on the system - they are so stupid).
439
440 # that means we can't find the libperl.so, because dbeian actively breaks
441 # their perl install, and we don't need it. we work around this by silently
442 # not including the libperl if we cannot find it.
443
444 if ($Config{useshrplib} eq "true") {
445 if (my $libperl = $self->{lib}{"CORE/$Config{libperl}"}) {
446 $self->{set}{"$self->{dlldir}/$Config{libperl}"} = $libperl;
447 }
448 }
449}
425 450
426=item $extractor->add_core_support 451=item $extractor->add_core_support
427 452
428Try to add modules and files needed to support commonly-used builtin 453Try to add modules and files needed to support commonly-used builtin
429language features. For example to open a scalar for I/O you need the 454language features. For example to open a scalar for I/O you need the

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines