From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 1DD40158008 for ; Tue, 13 Jun 2023 06:48:13 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 48047E0976; Tue, 13 Jun 2023 06:47:49 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 03114E095F for ; Tue, 13 Jun 2023 06:47:49 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH 1/7] pypi.eclass: Move setting globals to a function Date: Tue, 13 Jun 2023 08:45:01 +0200 Message-ID: <20230613064742.413335-2-mgorny@gentoo.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230613064742.413335-1-mgorny@gentoo.org> References: <20230613064742.413335-1-mgorny@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: 8cdfd697-2e07-4ec7-bfbb-57231687bdf8 X-Archives-Hash: 9873eaf357857d12d4adf67026727ddf Signed-off-by: Michał Górny --- 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 -- 2.41.0