Re: [PATCH v4 1/3] t/lib-httpd: dynamically detect httpd and modules path
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 11, 2023, 00:00 UTC
- Message-ID
- <xmqqo7g1tb06.fsf@gitster.g>
- In-Reply-To
- <41b9dada2e0b2e713328e6a4d31f713a2d3ffa38.1699596457.git.ps@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
> +if test -x "$DEFAULT_HTTPD_PATH"
> +then
> + DETECTED_HTTPD_ROOT="$("$DEFAULT_HTTPD_PATH" -V | sed -n 's/^ -D HTTPD_ROOT="\(.*\)"$/\1/p')"
> +fiWith this patch, my test run starts like so:
rm -f -r 'test-results'
*** prove ***
apache2: Could not open configuration file /etc/apache2/apache2.conf: No such file or directory
...I find the error message leaking mildly annoying, and would suggest doing something like the following on top.
diff --git c/t/lib-httpd.sh w/t/lib-httpd.sh index 0a74922d7f..03493ee72b 100644 --- c/t/lib-httpd.sh +++ w/t/lib-httpd.sh @@ -68,7 +68,7 @@ done if test -x "$DEFAULT_HTTPD_PATH" then - DETECTED_HTTPD_ROOT="$("$DEFAULT_HTTPD_PATH" -V | sed -n 's/^ -D HTTPD_ROOT="\(.*\)"$/\1/p')" + DETECTED_HTTPD_ROOT="$("$DEFAULT_HTTPD_PATH" -V 2>/dev/null | sed -n 's/^ -D HTTPD_ROOT="\(.*\)"$/\1/p')" fi for DEFAULT_HTTPD_MODULE_PATH in '/usr/libexec/apache2' \