File Coverage

File:config/auto/pod2man.pm
Coverage:95.5%

linestmtbrancondsubcode
1# Copyright (C) 2008, Parrot Foundation.
2
3 - 14
=head1 NAME

config/auto/pod2man - Check whether pod2man works

=head1 DESCRIPTION

Determines whether F<pod2man> exists on the system and where.

More specifically, we look for the F<pod2man> associated with the
instance of F<perl> with which F<Configure.pl> was invoked.

=cut
15
16package auto::pod2man;
17
18
2
2
2
use strict;
19
2
2
2
use warnings;
20
21
2
2
2
use base qw(Parrot::Configure::Step);
22
2
2
2
use Parrot::Configure::Utils ':auto';
23
24
25sub _init {
26
2
    my $self = shift;
27
2
    my %data;
28
2
    $data{description} = q{Is pod2man installed};
29
2
    $data{result} = q{};
30
2
    return \%data;
31}
32
33sub runstep {
34
2
    my ( $self, $conf ) = @_;
35
36
2
    my $cmd = $conf->data->get('scriptdirexp_provisional') . q{/pod2man};
37
2
    my $content = capture_output("$cmd docs/parrot.pod") || undef;
38
39
2
    return 1 unless defined( $self->_initial_content_check($conf, $content) );
40
2
    $conf->data->set(
41        has_pod2man => 1,
42        pod2man => $cmd
43    );
44
2
    return 1;
45}
46
47sub _initial_content_check {
48
3
    my $self = shift;
49
3
    my ($conf, $content) = @_;
50
3
    if (! defined $content) {
51
1
        $conf->data->set(
52            has_pod2man => 0,
53        );
54
1
        $self->set_result('no');
55
1
        return;
56    }
57    else {
58
2
        $self->set_result('yes');
59
2
        return 1;
60    }
61}
62
631;
64
65# Local Variables:
66# mode: cperl
67# cperl-indent-level: 4
68# fill-column: 100
69# End:
70# vim: expandtab shiftwidth=4: