configure: Tune fedabipkgdiff dependencies detection

If 'configure' finds some Python koji module, but it's "insufficient" per
the testing once added in commit 90d236a033
"Bug 22076 - Disable fedabipkgdiff for old koji clients", we currently get,
for example:

    [...]
    checking python3 module: koji... yes
    [...]
    checking checking if koji client is recent enough ...... Traceback (most recent call last):
      File "<string>", line 3, in <module>
      File "[...]/koji/__init__.py", line 2016, in read_config
        raise ConfigurationError("no configuration for profile name: %s"
    koji.ConfigurationError: no configuration for profile name: koji
    no, disabling fedpkgdiff
    [...]
                    Here is the configuration of the package:
    [...]
        Enable fedabipkgdiff                           : auto
    [...]

Note repeated 'checking' and '...', intermixed error output, 'fedpkgdiff'
typo, final 'auto' result.

Changing that to:

    [...]
    checking if koji client is recent enough... no
    configure: WARNING: disabling fedabipkgdiff
    [...]
                    Here is the configuration of the package:
    [...]
        Enable fedabipkgdiff                           : no
    [...]

... with 'config.log':

    [...]
    configure:13774: checking if koji client is recent enough
    configure:13784: result: no
    Traceback (most recent call last):
      File "<string>", line 3, in <module>
      File "[...]/koji/__init__.py", line 2016, in read_config
        raise ConfigurationError("no configuration for profile name: %s"
    koji.ConfigurationError: no configuration for profile name: koji
    configure:13792: WARNING: disabling fedabipkgdiff
    [...]

Similarly, with explicit '--enable-fedabipkgdiff', we currently get:

    [...]
    checking checking if koji client is recent enough ...... Traceback (most recent call last):
      File "<string>", line 3, in <module>
      File "[...]/koji/__init__.py", line 2016, in read_config
        raise ConfigurationError("no configuration for profile name: %s"
    koji.ConfigurationError: no configuration for profile name: koji
    no, disabling fedpkgdiff
    [...]
                    Here is the configuration of the package:
    [...]
        Enable fedabipkgdiff                           : yes
    [...]

... instead of a fatal error.

Changing that to:

    [...]
    checking if koji client is recent enough... no
    configure: error: unsuitable koji client

	* configure.ac: Tune fedabipkgdiff dependencies detection.

Signed-off-by: Thomas Schwinge <thomas@codesourcery.com>
This commit is contained in:
Thomas Schwinge
2021-12-11 19:18:52 +01:00
committed by Dodji Seketeli
parent 544d8b60ab
commit 7d30a3da42
+39 -38
View File
@@ -515,11 +515,10 @@ if test x$CHECK_DEPS_FOR_FEDABIPKGDIFF = xyes; then
AC_PATH_PROG(WGET, wget, no)
if test x$WGET = xno; then
ENABLE_FEDABIPKGDIFF=no
MISSING_FEDABIPKGDIFF_DEP=yes
if test x$MISSING_FEDABIPKGDIFF_DEP_FATAL = xyes; then
AC_MSG_ERROR(could not find the wget program)
else
MISSING_FEDABIPKGDIFF_DEP=yes
AC_MSG_NOTICE([could not find the wget program])
AC_MSG_NOTICE([disabling fedabipkgdiff as a result])
fi
@@ -549,47 +548,49 @@ if test x$CHECK_DEPS_FOR_FEDABIPKGDIFF = xyes; then
argparse logging os re subprocess sys $URLPARSE_MODULE \
xdg koji mock rpm imp tempfile mimetypes shutil six"
if test x$ENABLE_FEDABIPKGDIFF != xno; then
AX_CHECK_PYTHON_MODULES([$REQUIRED_PYTHON_MODULES_FOR_FEDABIPKGDIFF],
[$PYTHON],
[FOUND_ALL_PYTHON_MODULES=yes],
[FOUND_ALL_PYTHON_MODULES=no])
AX_CHECK_PYTHON_MODULES([$REQUIRED_PYTHON_MODULES_FOR_FEDABIPKGDIFF],
[$PYTHON],
[FOUND_ALL_PYTHON_MODULES=yes],
[FOUND_ALL_PYTHON_MODULES=no])
if test x$FOUND_ALL_PYTHON_MODULES = xno; then
MISSING_FEDABIPKGDIFF_DEP=yes
if test x$MISSING_FEDABIPKGDIFF_DEP_FATAL = xyes; then
AC_MSG_ERROR([missing python modules: $MISSING_PYTHON_MODULES]);
else
AC_MSG_NOTICE([missing python modules: $MISSING_PYTHON_MODULES])
AC_MSG_NOTICE([disabling fedabipkgdiff as a result])
fi
ENABLE_FEDABIPKGDIFF=no
if test x$FOUND_ALL_PYTHON_MODULES = xno; then
MISSING_FEDABIPKGDIFF_DEP=yes
if test x$MISSING_FEDABIPKGDIFF_DEP_FATAL = xyes; then
AC_MSG_ERROR([missing python modules: $MISSING_PYTHON_MODULES]);
else
# On some old platforms, the koji client object doesn't have
# the required .read_config method. Alas, that module doesn't
# have any __version__ string either. So we do as well as we
# can to try and detect that case and disable fedabipkgdiff if
# necessary.
AC_MSG_CHECKING([checking if koji client is recent enough ...])
$PYTHON -c "
AC_MSG_NOTICE([missing python modules: $MISSING_PYTHON_MODULES])
AC_MSG_NOTICE([disabling fedabipkgdiff as a result])
fi
else
# On some old platforms, the koji client object doesn't have
# the required .read_config method. Alas, that module doesn't
# have any __version__ string either. So we do as well as we
# can to try and detect that case and disable fedabipkgdiff if
# necessary.
AC_MSG_CHECKING([if koji client is recent enough])
$PYTHON 2>&AS_MESSAGE_LOG_FD -c "
import koji
koji.read_config('koji')"
if test $? -eq 0; then
koji_version_check_ok=yes
else
koji_version_check_ok=no
fi
if test x$koji_version_check_ok = xno; then
AC_MSG_RESULT([no, disabling fedpkgdiff])
MISSING_FEDABIPKGDIFF_DEP=yes
else
AC_MSG_RESULT(yes)
fi
if test x$MISSING_FEDABIPKGDIFF_DEP = xno; then
ENABLE_FEDABIPKGDIFF=yes
fi
if test $? -eq 0; then
koji_version_check_ok=yes
else
koji_version_check_ok=no
fi
AC_MSG_RESULT([$koji_version_check_ok])
if test x$koji_version_check_ok = xno; then
MISSING_FEDABIPKGDIFF_DEP=yes
if test x$MISSING_FEDABIPKGDIFF_DEP_FATAL = xyes; then
AC_MSG_ERROR([unsuitable koji client])
else
AC_MSG_WARN([disabling fedabipkgdiff])
fi
fi
fi
if test x$MISSING_FEDABIPKGDIFF_DEP = xno; then
ENABLE_FEDABIPKGDIFF=yes
else
ENABLE_FEDABIPKGDIFF=no
fi
fi