From 6690023f2848fc9bd407c9ce22b78c29270a16f0 Mon Sep 17 00:00:00 2001 From: Zoltan Boszormenyi Date: Fri, 10 Mar 2023 13:32:54 +0100 Subject: pypi.bbclass: Set SRC_URI downloadfilename with an optional prefix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows avoiding clashes between source archives of a main project and a pypi project using the same name and version. The new optional setting is PYPI_ARCHIVE_NAME_PREFIX which is empty by default so previous downloads can be used. Example usage: PYPI_ARCHIVE_NAME_PREFIX = "pypi-" (From OE-Core rev: 6f9a6a3dbe5c8eb9f0d19987410932fec3d6dd1a) Signed-off-by: Zoltán Böszörményi Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- meta/classes-recipe/pypi.bbclass | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'meta/classes-recipe/pypi.bbclass') diff --git a/meta/classes-recipe/pypi.bbclass b/meta/classes-recipe/pypi.bbclass index aab04c638f..f510bfed06 100644 --- a/meta/classes-recipe/pypi.bbclass +++ b/meta/classes-recipe/pypi.bbclass @@ -15,11 +15,13 @@ def pypi_package(d): PYPI_PACKAGE ?= "${@pypi_package(d)}" PYPI_PACKAGE_EXT ?= "tar.gz" PYPI_ARCHIVE_NAME ?= "${PYPI_PACKAGE}-${PV}.${PYPI_PACKAGE_EXT}" +PYPI_ARCHIVE_NAME_PREFIX ?= "" def pypi_src_uri(d): package = d.getVar('PYPI_PACKAGE') archive_name = d.getVar('PYPI_ARCHIVE_NAME') - return 'https://files.pythonhosted.org/packages/source/%s/%s/%s' % (package[0], package, archive_name) + archive_downloadname = d.getVar('PYPI_ARCHIVE_NAME_PREFIX') + archive_name + return 'https://files.pythonhosted.org/packages/source/%s/%s/%s;downloadfilename=%s' % (package[0], package, archive_name, archive_downloadname) PYPI_SRC_URI ?= "${@pypi_src_uri(d)}" -- cgit v1.2.3-54-g00ecf