aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Kjellerstedt <peter.kjellerstedt@axis.com>2023-04-29 03:23:28 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-05-25 10:31:57 +0100
commit4f2d8bcbaea33425f6de2c3c88a0beabec8a59f9 (patch)
tree1ebab2c595d76e881bdaf3b611a6b6f477832be9
parent879b830fcc60a022682ef22f58c04e7e07d03c63 (diff)
downloadbitbake-contrib-4f2d8bcbaea33425f6de2c3c88a0beabec8a59f9.tar.gz
fetch2/crate: Simplify extraction of crate names and versions from URIs
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/fetch2/crate.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/bb/fetch2/crate.py b/lib/bb/fetch2/crate.py
index a7021e5b3..2b8b6bc7a 100644
--- a/lib/bb/fetch2/crate.py
+++ b/lib/bb/fetch2/crate.py
@@ -59,11 +59,11 @@ class Crate(Wget):
# version is expected to be the last token
# but ignore possible url parameters which will be used
# by the top fetcher class
- version, _, _ = parts[len(parts) -1].partition(";")
+ version = parts[-1].split(";")[0]
# second to last field is name
- name = parts[len(parts) - 2]
+ name = parts[-2]
# host (this is to allow custom crate registries to be specified
- host = '/'.join(parts[2:len(parts) - 2])
+ host = '/'.join(parts[2:-2])
# if using upstream just fix it up nicely
if host == 'crates.io':