From: Thomas Perrot <[email protected]>
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 <[email protected]>
---
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.