… | |
… | |
514 | Adds the given (perl) program(s) to the file set, that is, a program |
514 | Adds the given (perl) program(s) to the file set, that is, a program |
515 | installed by some perl module, written in perl (an example would be the |
515 | installed by some perl module, written in perl (an example would be the |
516 | L<perl-libextractor> program that is part of the C<Perl::LibExtractor> |
516 | L<perl-libextractor> program that is part of the C<Perl::LibExtractor> |
517 | distribution). |
517 | distribution). |
518 | |
518 | |
|
|
519 | The program should be installed in one of the standard paths for perl |
|
|
520 | programs - C<$Config{sitebin}>, C<$Config{vendorbin}> or C<$Config{bin}>, |
|
|
521 | or must be specified via an absolute path (starting with F</>). |
|
|
522 | |
519 | Example: add the deliantra client program installed by the |
523 | Example: add the deliantra client program installed by the |
520 | L<Deliantra::Client> module and put it under F<bin/deliantra>. |
524 | L<Deliantra::Client> module and put it under F<bin/deliantra>. |
521 | |
525 | |
522 | $extractor->add_bin ("deliantra"); |
526 | $extractor->add_bin ("deliantra"); |
523 | |
527 | |
… | |
… | |
526 | sub add_bin { |
530 | sub add_bin { |
527 | my $self = shift; |
531 | my $self = shift; |
528 | |
532 | |
529 | exe: |
533 | exe: |
530 | for my $exe (@_) { |
534 | for my $exe (@_) { |
531 | for my $dir ($Config{sitebinexp}, $Config{vendorbinexp}, $Config{binexp}) { |
535 | for my $dir ($exe =~ m%^/% ? "" : (grep length, $Config{sitebinexp}, $Config{vendorbinexp}, $Config{binexp})) { |
532 | if (open my $fh, "<:perlio", "$dir/$exe") { |
536 | if (open my $fh, "<:perlio", "$dir/$exe") { |
533 | if (-f $fh) { |
537 | if (-f $fh) { |
534 | my $file = do { local $/; readline $fh }; |
538 | my $file = do { local $/; readline $fh }; |
535 | |
539 | |
536 | $self->_trace_flush if exists $self->{trace_check}; |
540 | $self->_trace_flush if exists $self->{trace_check}; |