diff options
author | Derek Straka <derek@asterius.io> | 2023-09-20 20:06:29 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-09-22 07:45:17 +0100 |
commit | 3c8cfbfc045fdf78382812c13a32dae2799c2898 (patch) | |
tree | e5f07dc9b79a3c9cec226fbccf5b5f746b1f11d9 | |
parent | c94c1ba7c77b2f7c599b4c0f24bab0c3b07ab6d3 (diff) | |
download | poky-3c8cfbfc045fdf78382812c13a32dae2799c2898.tar.gz |
pypi.bbclass: Update the upstream checks to automatically replace '_' with '-'
For a number of existing packages, the pypi URI contains '-', but the package name (PYPI_PACKAGE) uses '_'. Add a simple replace for the UPSTREAM_CHECK_URI and UPSTREAM_CHECK_REGEX. The change resulted in 19 additional auto-detected upstream checks for python packages meta-python.
It did break upstream checks for 3 packages that will be patched shortly:
- python3-ipython-genutils
- python3-ninja-syntax
- python3-wpa-supplicant
(From OE-Core rev: f4e2923bfac8a0a5b702ffd2dd957213a6268f6b)
Signed-off-by: Derek Straka <derek@asterius.io>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes-recipe/pypi.bbclass | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/meta/classes-recipe/pypi.bbclass b/meta/classes-recipe/pypi.bbclass index f510bfed06..b8c18ccf39 100644 --- a/meta/classes-recipe/pypi.bbclass +++ b/meta/classes-recipe/pypi.bbclass | |||
@@ -30,7 +30,9 @@ SECTION = "devel/python" | |||
30 | SRC_URI:prepend = "${PYPI_SRC_URI} " | 30 | SRC_URI:prepend = "${PYPI_SRC_URI} " |
31 | S = "${WORKDIR}/${PYPI_PACKAGE}-${PV}" | 31 | S = "${WORKDIR}/${PYPI_PACKAGE}-${PV}" |
32 | 32 | ||
33 | UPSTREAM_CHECK_URI ?= "https://pypi.org/project/${PYPI_PACKAGE}/" | 33 | # Replace any '_' characters in the pypi URI with '-'s to follow the PyPi website naming conventions |
34 | UPSTREAM_CHECK_REGEX ?= "/${PYPI_PACKAGE}/(?P<pver>(\d+[\.\-_]*)+)/" | 34 | UPSTREAM_CHECK_PYPI_PACKAGE ?= "${@d.getVar('PYPI_PACKAGE').replace('_', '-')}" |
35 | UPSTREAM_CHECK_URI ?= "https://pypi.org/project/${UPSTREAM_CHECK_PYPI_PACKAGE}/" | ||
36 | UPSTREAM_CHECK_REGEX ?= "/${UPSTREAM_CHECK_PYPI_PACKAGE}/(?P<pver>(\d+[\.\-_]*)+)/" | ||
35 | 37 | ||
36 | CVE_PRODUCT ?= "python:${PYPI_PACKAGE}" | 38 | CVE_PRODUCT ?= "python:${PYPI_PACKAGE}" |