summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2023-10-09 15:15:46 +0300
committerEfraim Flashner <efraim@flashner.co.il>2023-10-22 16:46:39 +0300
commit742554f9b973610a54ada9dee2971939cc36ddd7 (patch)
treeca28859d0f4a911ed45093af655df21236ecc234 /guix
parent6d4f4e916a4f6d00f33dd5b94bd2862695456b17 (diff)
guix: import: Don't import yanked rust crates.
* guix/import/crate.scm (<crate-version>): Add yanked? field. (crate->guix-package)[find-crate-version]: Remove versions which have been yanked. * tests/crate.scm: Adjust tests for new yanked? field.
Diffstat (limited to 'guix')
-rw-r--r--guix/import/crate.scm9
1 files changed, 7 insertions, 2 deletions
diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 6e10ebb5d4..43823d006e 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -5,6 +5,7 @@
;;; Copyright © 2021 Nicolas Goaziou <mail@nicolasgoaziou.fr>
;;; Copyright © 2022 Hartmut Goebel <h.goebel@crazy-compilers.com>
;;; Copyright © 2023 Simon Tournier <zimon.toutoune@gmail.com>
+;;; Copyright © 2023 Efraim Flashner <efraim@flashner.co.il>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -82,6 +83,7 @@
(match-lambda
('null #f)
((? string? str) str)))
+ (yanked? crate-version-yanked? "yanked") ;boolean
(links crate-version-links)) ;alist
;; Crate dependency. Each dependency (each edge in the graph) is annotated as
@@ -255,13 +257,16 @@ look up the development dependencs for the given crate."
(and (not (null-list? versions))
(semver->string (last versions)))))
- ;; find the highest version of a crate that fulfills the semver <range>
+ ;; Find the highest version of a crate that fulfills the semver <range>
+ ;; and hasn't been yanked.
(define (find-crate-version crate range)
(let* ((semver-range (string->semver-range range))
(versions
(sort
(filter (lambda (entry)
- (semver-range-contains? semver-range (first entry)))
+ (and
+ (not (crate-version-yanked? (second entry)))
+ (semver-range-contains? semver-range (first entry))))
(map (lambda (ver)
(list (string->semver (crate-version-number ver))
ver))