dev-python/flask-cors: Use best_version instead of equery
authorW. Trevor King <wking@tremily.us>
Sun, 14 Sep 2014 18:52:09 +0000 (11:52 -0700)
committerW. Trevor King <wking@tremily.us>
Mon, 15 Sep 2014 02:14:41 +0000 (19:14 -0700)
To find the location of the installed python-docs.  Zero_Chaos suggested
the best_version approach on #gentoo-python just now.

The installed version of these docs may soon change, with the
python-docs package shifting to a per-slot naming scheme that more
closely matches the upstream Python naming scheme [1].

[1]: https://bugs.gentoo.org/show_bug.cgi?id=522794

Thanks-to: Rick Farina (Zero_Chaos) <zerochaos@gentoo.org>

dev-python/flask-cors/flask-cors-9999.ebuild

index ca2ab58066d708907830b89334e810cdcb8fb918..7076ba36a77761f1301411bce5513809f38c1dca 100644 (file)
@@ -32,7 +32,6 @@ DEPEND="
        dev-python/setuptools[${PYTHON_USEDEP}]
        doc? (
                ${RDEPEND}
-               app-portage/gentoolkit
                >=dev-python/python-docs-2.7.6-r1:2.7
                dev-python/sphinx_rtd_theme[${PYTHON_USEDEP}]
        )
@@ -45,12 +44,10 @@ S="${WORKDIR}/${MY_P}"
 
 python_prepare_all() {
        if use doc; then
-               local PYTHON_DOC_INVENTORY=$(equery files python-docs | grep objects.inv | tail -n1)
-               if [[ -z "${PYTHON_DOC_INVENTORY}" ]]
-               then
-                       die "objects.inv not found in python-docs"
-               fi
-               PYTHON_DOC="${PYTHON_DOC_INVENTORY%%objects.inv}"
+               local PYTHON_DOC_ATOM=$(best_version --host-root dev-python/python-docs:2.7)
+               local PYTHON_DOC_VERSION="${PYTHON_DOC_ATOM#dev-python/python-docs-}"
+               local PYTHON_DOC="/usr/share/doc/python-docs-${PYTHON_DOC_VERSION}/html"
+               local PYTHON_DOC_INVENTORY="${PYTHON_DOC}/objects.inv"
                sed -i "s|'http://docs.python.org/': None|'${PYTHON_DOC}': '${PYTHON_DOC_INVENTORY}'|" docs/conf.py || die
        fi
        distutils-r1_python_prepare_all