Openembedded Bitbake Development
 help / color / mirror / Atom feed
* [bitbake-devel][PATCH] fetch2/crate: skip yanked versions when reading cargo index
@ 2026-05-07 14:36 thomas.perrot
  0 siblings, 0 replies; only message in thread
From: thomas.perrot @ 2026-05-07 14:36 UTC (permalink / raw)
  To: bitbake-devel; +Cc: thomas.petazzoni, Thomas Perrot

From: Thomas Perrot <thomas.perrot@bootlin.com>

The cargo sparse index marks yanked crate versions with "yanked": true.
Treat those the same way as non-existing versions so that version
checking never promotes a yanked release as the latest one.

Signed-off-by: Thomas Perrot <thomas.perrot@bootlin.com>
---
 lib/bb/fetch2/crate.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/bb/fetch2/crate.py b/lib/bb/fetch2/crate.py
index b89817ab94d5..d84bae0bcd1e 100644
--- a/lib/bb/fetch2/crate.py
+++ b/lib/bb/fetch2/crate.py
@@ -178,7 +178,8 @@ class Crate(Wget):
         response = self._fetch_index(ud.versionsurl, ud, d)
         for line in response.splitlines():
             data = json.loads(line)
-            versions.append((0, data["vers"], ""))
+            if not data.get("yanked", False):
+                versions.append((0, data["vers"], ""))
 
         versions = sorted(versions, key=cmp_to_key(bb.utils.vercmp))
         return (versions[-1][1], "")
-- 
2.54.0



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-05-07 14:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-07 14:36 [bitbake-devel][PATCH] fetch2/crate: skip yanked versions when reading cargo index thomas.perrot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox