commit:     0950b698411ea7ffbafe868d231b18181da77e28
Author:     Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net>
AuthorDate: Sat Jan 16 13:27:00 2021 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Thu Jan 28 09:20:05 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0950b698

eclass/distutils-r1: fix distutils_enable_sphinx with DIS.._SINGLE_IMPL

python-single-r1 does not have the python_gen_any_dep function
use the python_gen_cond_dep instead

Closes: https://bugs.gentoo.org/704520
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> riseup.net>
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 eclass/distutils-r1.eclass | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 5ffc91be479..c5c954f4925 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: distutils-r1.eclass
@@ -316,22 +316,25 @@ distutils_enable_sphinx() {
        _DISTUTILS_SPHINX_PLUGINS=( "${@}" )
 
        local deps autodoc=1 d
+       deps="dev-python/sphinx[\${PYTHON_USEDEP}]"
        for d; do
                if [[ ${d} == --no-autodoc ]]; then
                        autodoc=
                else
                        deps+="
                                ${d}[\${PYTHON_USEDEP}]"
+                       if [[ ! ${autodoc} ]]; then
+                               die "${FUNCNAME}: do not pass --no-autodoc if 
external plugins are used"
+                       fi
                fi
        done
 
-       if [[ ! ${autodoc} && -n ${deps} ]]; then
-               die "${FUNCNAME}: do not pass --no-autodoc if external plugins 
are used"
-       fi
        if [[ ${autodoc} ]]; then
-               deps="$(python_gen_any_dep "
-                       dev-python/sphinx[\${PYTHON_USEDEP}]
-                       ${deps}")"
+               if [[ ${DISTUTILS_SINGLE_IMPL} ]]; then
+                       deps="$(python_gen_cond_dep "${deps}")"
+               else
+                       deps="$(python_gen_any_dep "${deps}")"
+               fi
 
                python_check_deps() {
                        use doc || return 0

Reply via email to