Skip to content
This repository was archived by the owner on Apr 10, 2025. It is now read-only.

Commit 68185b8

Browse files
authored
installer: allow --dynamic-module to be used with tags (#1334)
* installer: allow --dynamic-module to be used with tags A user-friendly check with dynamic module building tries to warn people early if the version of ngx_pagespeed they're building is too old to be compiled as a dynamic module, but this can't work with tags. If we're given something other than a numeric version number, don't try to perform this check. Fixes apache/incubator-pagespeed-mod#1443
1 parent 7f225e2 commit 68185b8

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

scripts/build_ngx_pagespeed.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -420,8 +420,15 @@ function build_ngx_pagespeed() {
420420

421421
if "$DYNAMIC_MODULE"; then
422422
# Check that ngx_pagespeed and nginx are recent enough to support dynamic
423-
# modules.
424-
if version_older_than "$NPS_VERSION" "1.10.33.5"; then
423+
# modules. Unfortunately NPS_VERSION might be a tag, in which case we don't
424+
# know. If it's not a numeric version number, then assume it's recent
425+
# enough and if it's not they'll get an ugly compilation error later.
426+
# Luckily 1.10.33.5 was a while ago now.
427+
#
428+
# I'd like to use =~ here, but they changed syntax between v3 and v4 (quotes
429+
# moved from mandatory to optional to prohibited).
430+
if [[ "${NPS_VERSION#*[^0-9.]}" = "$NPS_VERSION" ]] &&
431+
version_older_than "$NPS_VERSION" "1.10.33.5"; then
425432
fail "
426433
You're trying to build ngx_pagespeed $NPS_VERSION as a dynamic module, but
427434
ngx_pagespeed didn't add support for dynamic modules until 1.10.33.5."

0 commit comments

Comments
 (0)