commit:     87807b72eb990e9f9dd8b768c1b9ea0d054a0118
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 12 19:23:41 2023 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jun 15 12:19:21 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=87807b72

pypi.eclass: Move setting globals to a function

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 eclass/pypi.eclass | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/eclass/pypi.eclass b/eclass/pypi.eclass
index 13dd56fa4fec..732b0c6184ef 100644
--- a/eclass/pypi.eclass
+++ b/eclass/pypi.eclass
@@ -221,12 +221,20 @@ pypi_wheel_url() {
        fi
 }
 
-if [[ ${PYPI_NO_NORMALIZE} ]]; then
-       SRC_URI="$(pypi_sdist_url --no-normalize)"
-       S="${WORKDIR}/${PYPI_PN}-$(pypi_translate_version "${PV}")"
-else
-       SRC_URI="$(pypi_sdist_url)"
-       S="${WORKDIR}/$(pypi_normalize_name 
"${PYPI_PN}")-$(pypi_translate_version "${PV}")"
-fi
+# @FUNCTION: _pypi_set_globals
+# @INTERNAL
+# @DESCRIPTION:
+# Set global variables, SRC_URI and S.
+_pypi_set_globals() {
+       if [[ ${PYPI_NO_NORMALIZE} ]]; then
+               SRC_URI="$(pypi_sdist_url --no-normalize)"
+               S="${WORKDIR}/${PYPI_PN}-$(pypi_translate_version "${PV}")"
+       else
+               SRC_URI="$(pypi_sdist_url)"
+               S="${WORKDIR}/$(pypi_normalize_name 
"${PYPI_PN}")-$(pypi_translate_version "${PV}")"
+       fi
+}
+
+_pypi_set_globals
 
 fi

Reply via email to