nginx{,-module}.eclass: do not fail if econf_ngx --help is called

NGINX's ./configure return 1 if "--help" is passed. edo does not like it
and thinks the command failed. The previous code was incorrect in how it
handled the "--help" case.

edo actually never failed (since it was always called with nonfatal,
even when no "--help" was passed), only showed the edo's "Failed to run
command" message.

This commit fixes the --help and all other cases altogether, making
econf_ngx fail when necessary and shut when not.

Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/42895
Closes: https://github.com/gentoo/gentoo/pull/42895
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Zurab Kvachadze 2025-07-06 01:47:39 +02:00 committed by Sam James
parent 4eb0d941de
commit f414b6c3a5
No known key found for this signature in database
GPG Key ID: 738409F520DF9190
2 changed files with 16 additions and 10 deletions

View File

@ -109,12 +109,15 @@ econf_ngx() {
debug-print-function "${FUNCNAME[0]}" "$@"
[[ ! -x ./configure ]] &&
die "./configure is not present in the current working directory or is not executable"
nonfatal edo ./configure "$@"
# For some reason, NGINX's ./configure returns 1 if it is used with the
# '--help' argument.
if [[ $? -ne 0 && "$1" != --help ]]; then
die -n "./configure ${*@Q} failed"
if [[ $1 == --help ]]; then
# For some reason, NGINX ./configure returns 1 if it is used with the
# '--help' argument.
#
# Executing this without edo gets rid of the "Failed to run" message.
./configure "$@"
return
fi
edo ./configure "$@"
}
# @FUNCTION: ngx_mod_pkg_to_sonames

View File

@ -267,12 +267,15 @@ econf_ngx() {
debug-print-function "${FUNCNAME[0]}" "$@"
[[ -x ./configure ]] ||
die "./configure is not present in the current working directory or is not executable"
nonfatal edo ./configure "$@"
# For some reason, NGINX ./configure returns 1 if it is used with the
# '--help' argument.
if [[ $? -ne 0 && $1 != --help ]]; then
die -n "./configure ${*@Q} failed"
if [[ $1 == --help ]]; then
# For some reason, NGINX ./configure returns 1 if it is used with the
# '--help' argument.
#
# Executing this without edo gets rid of the "Failed to run" message.
./configure "$@"
return
fi
edo ./configure "$@"
}
#-----> USE logic <-----