Jeff King wrote:
> On Tue, Jan 02, 2018 at 07:39:46PM -0500, Todd Zullinger wrote:
>> I don't know if there's a clean way to do that
>> automatically, short of parsing the output of 'httpd -v'
>> should we ever need to add such a prereq.
>
> In the general case, we could probably define an endpoint within an <If>
> block, and then try to access the endpoint from the test script.
>
> E.g., something like:
>
> <IfVersion >= 2.4>
> Alias /have-2.4.txt www/yes.txt
> </IfVersion>
>
> in the apache config, and then:
>
> test_lazy_prereq APACHE24 '
> echo yes >"$HTTPD_DOCUMENT_ROOT_PATH/yes.txt" &&
> curl -f "$HTTPD_URL/have-2.4.txt"
> '
>
> in the test script (of course we may not want to depend on having
> command-line curl, but we could replace that with "git ls-remote" or
> similar).
>
> One nice thing about that approach is that it can be extended to other
> "If" blocks, like if we have a particular module available, or if ssl is
> configured.
That's quite elegant. I even modified an IfVersion block
and didn't think about using it that way to create a prereq.
Neat!
--
Todd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You're not drunk if you can lie on the floor without holding on.
-- Dean Martin