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.25 by root, Mon Sep 23 07:57:55 2013 UTC vs.
Revision 1.26 by root, Mon Sep 23 13:03:48 2013 UTC

514Adds the given (perl) program(s) to the file set, that is, a program 514Adds the given (perl) program(s) to the file set, that is, a program
515installed by some perl module, written in perl (an example would be the 515installed by some perl module, written in perl (an example would be the
516L<perl-libextractor> program that is part of the C<Perl::LibExtractor> 516L<perl-libextractor> program that is part of the C<Perl::LibExtractor>
517distribution). 517distribution).
518 518
519The program should be installed in one of the standard paths for perl
520programs - C<$Config{sitebin}>, C<$Config{vendorbin}> or C<$Config{bin}>,
521or must be specified via an absolute path (starting with F</>).
522
519Example: add the deliantra client program installed by the 523Example: add the deliantra client program installed by the
520L<Deliantra::Client> module and put it under F<bin/deliantra>. 524L<Deliantra::Client> module and put it under F<bin/deliantra>.
521 525
522 $extractor->add_bin ("deliantra"); 526 $extractor->add_bin ("deliantra");
523 527
526sub add_bin { 530sub 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};

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines