Skip to content

Commit d762617

Browse files
peffgitster
authored andcommitted
t/lib-httpd: bump required apache version to 2.2
Apache 2.2 was released in 2005, almost 18 years ago. We can probably assume that people are running a version at least that old (and the stakes for removing it are fairly low, as the worst case is that they would not run the http tests against their ancient version). Dropping support for the older versions cleans up the config file a little, and will also enable us to bump the required version further (with more cleanups) in a future patch. Note that the file actually checks for version 2.1. In apache's versioning scheme, odd numbered versions are for development and even numbers are for stable releases. So 2.1 and 2.2 are effectively the same from our perspective. Older versions would just fail to start, which would generally cause us to skip the tests. However, we do have version detection code in lib-httpd.sh which produces a nicer error message, so let's update that, too. I didn't bother handling the case of "3.0", etc. Apache has been on 2.x for 21 years, with no signs of bumping the major version. And if they eventually do, I suspect there will be enough breaking changes that we'd need to update more than just the numeric version check. We can worry about that hypothetical when it happens. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 844ede3 commit d762617

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

t/lib-httpd.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,16 +99,19 @@ then
9999
fi
100100

101101
HTTPD_VERSION=$($LIB_HTTPD_PATH -v | \
102-
sed -n 's/^Server version: Apache\/\([0-9]*\)\..*$/\1/p; q')
102+
sed -n 's/^Server version: Apache\/\([0-9.]*\).*$/\1/p; q')
103+
HTTPD_VERSION_MAJOR=$(echo $HTTPD_VERSION | cut -d. -f1)
104+
HTTPD_VERSION_MINOR=$(echo $HTTPD_VERSION | cut -d. -f2)
103105

104-
if test -n "$HTTPD_VERSION"
106+
if test -n "$HTTPD_VERSION_MAJOR"
105107
then
106108
if test -z "$LIB_HTTPD_MODULE_PATH"
107109
then
108-
if ! test $HTTPD_VERSION -ge 2
110+
if ! test "$HTTPD_VERSION_MAJOR" -eq 2 ||
111+
! test "$HTTPD_VERSION_MINOR" -ge 2
109112
then
110113
test_skip_or_die GIT_TEST_HTTPD \
111-
"at least Apache version 2 is required"
114+
"at least Apache version 2.2 is required"
112115
fi
113116
if ! test -d "$DEFAULT_HTTPD_MODULE_PATH"
114117
then

t/lib-httpd/apache.conf

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,6 @@ Protocols h2c
3838
LockFile accept.lock
3939
</IfVersion>
4040

41-
<IfVersion < 2.1>
42-
<IfModule !mod_auth.c>
43-
LoadModule auth_module modules/mod_auth.so
44-
</IfModule>
45-
</IfVersion>
46-
47-
<IfVersion >= 2.1>
4841
<IfModule !mod_auth_basic.c>
4942
LoadModule auth_basic_module modules/mod_auth_basic.so
5043
</IfModule>
@@ -57,7 +50,6 @@ LockFile accept.lock
5750
<IfModule !mod_authz_host.c>
5851
LoadModule authz_host_module modules/mod_authz_host.so
5952
</IfModule>
60-
</IfVersion>
6153

6254
<IfVersion >= 2.4>
6355
<IfModule !mod_authn_core.c>

0 commit comments

Comments
 (0)