From: Patrick Steinhardt <ps@pks.im>
To: git@vger.kernel.org
Cc: Junio C Hamano <gitster@pobox.com>
Subject: [PATCH v2 0/3] t: improve compatibility with NixOS
Date: Wed, 8 Nov 2023 15:57:15 +0100 [thread overview]
Message-ID: <cover.1699455383.git.ps@pks.im> (raw)
In-Reply-To: <cover.1699428122.git.ps@pks.im>
[-- Attachment #1: Type: text/plain, Size: 4332 bytes --]
Hi,
this is the second version of my patch series to improve compatibility
of our tests with NixOS.
There's only a single change compared to v1. As suggested by Junio, we
now use the executable discovered via PATH and the modules detected via
`HTTPD_ROOT` as fallback values if none of our hardcoded paths were
detected. This should further ensure that the refactoring doesn't cause
any issues on platforms that follow the FHS more closely than NixOS
does. It also has the benefit that the change is now a lot more straight
forward.
Patrick
Patrick Steinhardt (3):
t/lib-httpd: dynamically detect httpd and modules path
t/lib-httpd: stop using legacy crypt(3) for authentication
t9164: fix inability to find basename(1) in hooks
t/lib-httpd.sh | 10 ++++++++--
t/lib-httpd/passwd | 2 +-
t/lib-httpd/proxy-passwd | 2 +-
t/t9164-git-svn-dcommit-concurrent.sh | 12 +++++++++---
4 files changed, 19 insertions(+), 7 deletions(-)
Range-diff against v1:
1: ac059db8fed ! 1: cee8fbebf84 t/lib-httpd: dynamically detect httpd and modules path
@@ Commit message
- The module directory can (in many cases) be derived via the
`HTTPD_ROOT` compile-time variable.
- Refactor the code to do so. If runtime detection of the paths fails we
- continue to fall back to the hardcoded list of paths.
+ Amend the code to do so. The new runtime-detected paths will only be
+ used in case none of the hardcoded paths are usable.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
@@ t/lib-httpd.sh: fi
HTTPD_PARA=""
-for DEFAULT_HTTPD_PATH in '/usr/sbin/httpd' '/usr/sbin/apache2'
--do
-- if test -x "$DEFAULT_HTTPD_PATH"
-- then
-- break
-- fi
--done
--
--for DEFAULT_HTTPD_MODULE_PATH in '/usr/libexec/apache2' \
-- '/usr/lib/apache2/modules' \
-- '/usr/lib64/httpd/modules' \
-- '/usr/lib/httpd/modules' \
-- '/usr/libexec/httpd'
--do
-- if test -d "$DEFAULT_HTTPD_MODULE_PATH"
-+DEFAULT_HTTPD_PATH="$(command -v httpd)"
-+if test -z "$DEFAULT_HTTPD_PATH" -o ! -x "$DEFAULT_HTTPD_PATH"
-+then
-+ for DEFAULT_HTTPD_PATH in '/usr/sbin/httpd' '/usr/sbin/apache2'
-+ do
-+ if test -x "$DEFAULT_HTTPD_PATH"
-+ then
-+ break
-+ fi
-+ done
-+fi
-+
-+if test -x "$DEFAULT_HTTPD_PATH"
-+then
-+ HTTPD_ROOT="$("$DEFAULT_HTTPD_PATH" -V | sed -n 's/^ -D HTTPD_ROOT="\(.*\)"$/\1/p')"
-+ if test -n "$HTTPD_ROOT" -a -d "$HTTPD_ROOT/modules"
++for DEFAULT_HTTPD_PATH in '/usr/sbin/httpd' '/usr/sbin/apache2' "$(command -v httpd)"
+ do
+ if test -x "$DEFAULT_HTTPD_PATH"
then
-- break
-+ DEFAULT_HTTPD_MODULE_PATH="$HTTPD_ROOT/modules"
+@@ t/lib-httpd.sh: do
fi
--done
-+ unset HTTPD_ROOT
-+fi
-+
-+if test -z "$DEFAULT_HTTPD_MODULE_PATH" -o ! -d "$DEFAULT_HTTPD_MODULE_PATH"
+ done
+
++if test -x "$DEFAULT_HTTPD_PATH"
+then
-+ for DEFAULT_HTTPD_MODULE_PATH in '/usr/libexec/apache2' \
-+ '/usr/lib/apache2/modules' \
-+ '/usr/lib64/httpd/modules' \
-+ '/usr/lib/httpd/modules' \
-+ '/usr/libexec/httpd'
-+ do
-+ if test -d "$DEFAULT_HTTPD_MODULE_PATH"
-+ then
-+ break
-+ fi
-+ done
++ DETECTED_HTTPD_ROOT="$("$DEFAULT_HTTPD_PATH" -V | sed -n 's/^ -D HTTPD_ROOT="\(.*\)"$/\1/p')"
+fi
-
- case $(uname) in
- Darwin)
++
+ for DEFAULT_HTTPD_MODULE_PATH in '/usr/libexec/apache2' \
+ '/usr/lib/apache2/modules' \
+ '/usr/lib64/httpd/modules' \
+ '/usr/lib/httpd/modules' \
+- '/usr/libexec/httpd'
++ '/usr/libexec/httpd' \
++ "${DETECTED_HTTPD_ROOT:+${DETECTED_HTTPD_ROOT}/modules}"
+ do
+ if test -d "$DEFAULT_HTTPD_MODULE_PATH"
+ then
2: 23835763002 = 2: f4c6c754f1e t/lib-httpd: stop using legacy crypt(3) for authentication
3: b50e625f967 = 3: 361f1bd9c88 t9164: fix inability to find basename(1) in hooks
base-commit: 98009afd24e2304bf923a64750340423473809ff
--
2.42.0
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2023-11-08 14:57 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-08 7:29 [PATCH 0/3] t: improve compatibility with NixOS Patrick Steinhardt
2023-11-08 7:29 ` [PATCH 1/3] t/lib-httpd: dynamically detect httpd and modules path Patrick Steinhardt
2023-11-08 7:59 ` Junio C Hamano
2023-11-08 10:42 ` Patrick Steinhardt
2023-11-08 16:44 ` Jeff King
2023-11-08 7:30 ` [PATCH 2/3] t/lib-httpd: stop using legacy crypt(3) for authentication Patrick Steinhardt
2023-11-08 8:01 ` Junio C Hamano
2023-11-08 7:30 ` [PATCH 3/3] t9164: fix inability to find basename(1) in hooks Patrick Steinhardt
2023-11-08 14:57 ` Patrick Steinhardt [this message]
2023-11-08 14:57 ` [PATCH v2 1/3] t/lib-httpd: dynamically detect httpd and modules path Patrick Steinhardt
2023-11-08 16:54 ` Jeff King
2023-11-09 0:30 ` Junio C Hamano
2023-11-09 6:30 ` Patrick Steinhardt
2023-11-08 14:57 ` [PATCH v2 2/3] t/lib-httpd: stop using legacy crypt(3) for authentication Patrick Steinhardt
2023-11-08 17:02 ` Jeff King
2023-11-08 14:57 ` [PATCH v2 3/3] t9164: fix inability to find basename(1) in hooks Patrick Steinhardt
2023-11-08 17:21 ` Jeff King
2023-11-08 17:43 ` Junio C Hamano
2023-11-09 6:30 ` Patrick Steinhardt
2023-11-09 7:02 ` Patrick Steinhardt
2023-11-09 7:09 ` [PATCH v3 0/3] t: improve compatibility with NixOS Patrick Steinhardt
2023-11-09 7:09 ` [PATCH v3 1/3] t/lib-httpd: dynamically detect httpd and modules path Patrick Steinhardt
2023-11-09 7:32 ` Jeff King
2023-11-09 7:36 ` Patrick Steinhardt
2023-11-09 7:46 ` Junio C Hamano
2023-11-09 7:57 ` Patrick Steinhardt
2023-11-09 7:48 ` Jeff King
2023-11-09 7:09 ` [PATCH v3 2/3] t/lib-httpd: stop using legacy crypt(3) for authentication Patrick Steinhardt
2023-11-09 7:10 ` [PATCH v3 3/3] t9164: fix inability to find basename(1) in Subversion hooks Patrick Steinhardt
2023-11-09 7:35 ` Jeff King
2023-11-09 7:36 ` [PATCH v3 0/3] t: improve compatibility with NixOS Jeff King
2023-11-10 8:16 ` [PATCH v4 " Patrick Steinhardt
2023-11-10 8:17 ` [PATCH v4 1/3] t/lib-httpd: dynamically detect httpd and modules path Patrick Steinhardt
2023-11-11 0:00 ` Junio C Hamano
2023-11-13 7:15 ` Patrick Steinhardt
2023-11-10 8:17 ` [PATCH v4 2/3] t/lib-httpd: stop using legacy crypt(3) for authentication Patrick Steinhardt
2023-11-10 8:17 ` [PATCH v4 3/3] t9164: fix inability to find basename(1) in Subversion hooks Patrick Steinhardt
2023-11-10 21:41 ` [PATCH v4 0/3] t: improve compatibility with NixOS Jeff King
2023-11-11 0:10 ` Junio C Hamano
2023-11-13 7:15 ` Patrick Steinhardt
2023-11-13 23:42 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1699455383.git.ps@pks.im \
--to=ps@pks.im \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).