commit: f414b6c3a528feae0d6006b54870067f27babd94
Author: Zurab Kvachadze <zurabid2016 <AT> gmail <DOT> com>
AuthorDate: Sat Jul 5 23:47:39 2025 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jul 7 22:24:31 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f414b6c3
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 <AT> 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 <AT> gentoo.org>
eclass/nginx-module.eclass | 13 ++++++++-----
eclass/nginx.eclass | 13 ++++++++-----
2 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/eclass/nginx-module.eclass b/eclass/nginx-module.eclass
index ee2071cbf77b..d25c961af8fd 100644
--- a/eclass/nginx-module.eclass
+++ b/eclass/nginx-module.eclass
@@ -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
diff --git a/eclass/nginx.eclass b/eclass/nginx.eclass
index 170e7f152af8..86ebe194b157 100644
--- a/eclass/nginx.eclass
+++ b/eclass/nginx.eclass
@@ -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 <-----