Skip to contentSkip to conversation

fetch2/crate: Simplify extraction of crate names and versions from URIs

PATCH Peter Kjellerstedt 1 participant 1 message May 22, 2023 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

*ping*

Were there any problems with these two patches, or were they just missed?

//Peter

Quoted 38 lines

-----Original Message-----
From: [email protected] <bitbake- [email protected]> On Behalf Of Peter Kjellerstedt
Sent: den 29 april 2023 03:23
To: [email protected]
Subject: [bitbake-devel] [master][mickledore][PATCH 1/2] fetch2/crate:
Simplify extraction of crate names and versions from URIs

---

@Steve Sakoman: Since this is a clean up patch, I will leave it up to you to decide if you want to take it for Mickledore once it makes it into master.

 bitbake/lib/bb/fetch2/crate.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
bitbake/lib/bb/fetch2/crate.py +3 -3
index a7021e5b36..2b8b6bc7a1 100644
@@ -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':