Here's another case where I don't understand the logic of a particular
configuration step class's runstep() method:  auto::aio.  (In what
follows, I eliminate whitespace, comments and references to verbosity
where appropriate.)

    my $test;
    my $libs    = $conf->data->get('libs');
    $conf->data->add( ' ', libs => '-lrt' );

We run a first stage to our probe for aio.

    cc_gen('config/auto/aio/aio.in');
    eval { cc_build(); };
    if ( !$@ ) {
    
So far so good, if there is an error message, we skip to the else block
at the end of the method.  But if there is no error message, we have to
conduct a second stage to our probe.
    
        $test = cc_run(35);

        # if the test is failing with sigaction err
        # we should repeat it with a different signal number

The above comment is very confusing.  If I assume that 'test' refers to
cc_run(35), then what constitutes failure?  Let's assume that I know the
answer to that question.  In what follows, is cc_run re-run?  Not as far
as I can tell!
 
        if (
            $test =~ /SIGRTMIN=(\d+)\sSIGRTMAX=(\d+)\n
                INFO=42\n
                ok/x
        ) {
            $self->set_result('yes');
            $conf->data->set( # 4 attributes are set #);
        }

Wait a minute!  Why is there no interior 'else' stanza here?  If that
regex isn't matched, then no step result is set and $conf->data->libs
retains the value it had before the first stage of the test.

    }
    else {
        $conf->data->set( libs => $libs );
        $self->set_result('no');
    }

The 'else' stanza above only applies if the 'eval' of cc_build failed.

Can anyone help clear up the confusion?  Thank you very much.

kid51

Reply via email to