Skip to content

Commit 0946acf

Browse files
committed
Merge branch 'ps/httpd-tests-on-nixos'
Portability tweak. * ps/httpd-tests-on-nixos: t9164: fix inability to find basename(1) in Subversion hooks t/lib-httpd: stop using legacy crypt(3) for authentication t/lib-httpd: dynamically detect httpd and modules path
2 parents 564d025 + 0856f13 commit 0946acf

File tree

4 files changed

+23
-7
lines changed

4 files changed

+23
-7
lines changed

t/lib-httpd.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,30 @@ fi
5555

5656
HTTPD_PARA=""
5757

58-
for DEFAULT_HTTPD_PATH in '/usr/sbin/httpd' '/usr/sbin/apache2'
58+
for DEFAULT_HTTPD_PATH in '/usr/sbin/httpd' \
59+
'/usr/sbin/apache2' \
60+
"$(command -v httpd)" \
61+
"$(command -v apache2)"
5962
do
60-
if test -x "$DEFAULT_HTTPD_PATH"
63+
if test -n "$DEFAULT_HTTPD_PATH" && test -x "$DEFAULT_HTTPD_PATH"
6164
then
6265
break
6366
fi
6467
done
6568

69+
if test -x "$DEFAULT_HTTPD_PATH"
70+
then
71+
DETECTED_HTTPD_ROOT="$("$DEFAULT_HTTPD_PATH" -V 2>/dev/null | sed -n 's/^ -D HTTPD_ROOT="\(.*\)"$/\1/p')"
72+
fi
73+
6674
for DEFAULT_HTTPD_MODULE_PATH in '/usr/libexec/apache2' \
6775
'/usr/lib/apache2/modules' \
6876
'/usr/lib64/httpd/modules' \
6977
'/usr/lib/httpd/modules' \
70-
'/usr/libexec/httpd'
78+
'/usr/libexec/httpd' \
79+
"${DETECTED_HTTPD_ROOT:+${DETECTED_HTTPD_ROOT}/modules}"
7180
do
72-
if test -d "$DEFAULT_HTTPD_MODULE_PATH"
81+
if test -n "$DEFAULT_HTTPD_MODULE_PATH" && test -d "$DEFAULT_HTTPD_MODULE_PATH"
7382
then
7483
break
7584
fi

t/lib-httpd/passwd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
user@host:xb4E8pqD81KQs
1+
user@host:$apr1$LGPmCZWj$9vxEwj5Z5GzQLBMxp3mCx1

t/lib-httpd/proxy-passwd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
proxuser:2x7tAukjAED5M
1+
proxuser:$apr1$RxS6MLkD$DYsqQdflheq4GPNxzJpx5.

t/t9164-git-svn-dcommit-concurrent.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ setup_hook()
4646
"passed to setup_hook" >&2 ; return 1; }
4747
echo "cnt=$skip_revs" > "$hook_type-counter"
4848
rm -f "$rawsvnrepo/hooks/"*-commit # drop previous hooks
49+
50+
# Subversion hooks run with an empty environment by default. We thus
51+
# need to propagate PATH so that we can find executables.
52+
cat >"$rawsvnrepo/conf/hooks-env" <<-EOF
53+
[default]
54+
PATH = ${PATH}
55+
EOF
56+
4957
hook="$rawsvnrepo/hooks/$hook_type"
5058
cat > "$hook" <<- 'EOF1'
5159
#!/bin/sh
@@ -63,7 +71,6 @@ EOF1
6371
if [ "$hook_type" = "pre-commit" ]; then
6472
echo "echo 'commit disallowed' >&2; exit 1" >>"$hook"
6573
else
66-
echo "PATH=\"$PATH\"; export PATH" >>"$hook"
6774
echo "svnconf=\"$svnconf\"" >>"$hook"
6875
cat >>"$hook" <<- 'EOF2'
6976
cd work-auto-commits.svn

0 commit comments

Comments
 (0)