From: Zoltan Boszormenyi Date: Fri, 10 Mar 2023 12:32:54 +0000 (+0100) Subject: pypi.bbclass: Set SRC_URI downloadfilename with an optional prefix X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~1411 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f9a6a3dbe5c8eb9f0d19987410932fec3d6dd1a;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git pypi.bbclass: Set SRC_URI downloadfilename with an optional prefix 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-" Signed-off-by: Zoltán Böszörményi Signed-off-by: Alexandre Belloni Signed-off-by: Richard Purdie --- diff --git a/meta/classes-recipe/pypi.bbclass b/meta/classes-recipe/pypi.bbclass index aab04c638fa..f510bfed06f 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)}"