Subject: [bug#75496] [PATCH rust-team 1/2] import: crate: Fix find-package-version.

From: Herman Rimm <[email-masked]>
Date: Sat, 11 Jan 2025 15:37:06 +0100

Fixes bug from 5ce1512b0f68cf39cb399623a14302f309c06129, where the
earliest existing package (if any) was returned instead.  See also:

https://issues.guix.gnu.org/68346#3-lineno97

* guix/import/crate.scm (crate->guix-package)[find-package-version]:
Invert boolean expression.

Change-Id: I1d05f55a027241e7c5f62cc98a50a09b5639bdcf
---
 guix/import/crate.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index b4806c8bb22..a7134b85722 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -335,9 +335,9 @@ (define* (crate->guix-package
                           (find-packages-by-name
                            (crate-name->package-name name))))
              (match-lambda* (((semver1 yanked1) (semver2 yanked2))
-                             (or (and yanked1 (not yanked2))
-                                 (and (eq? yanked1 yanked2)
-                                      (semver<? semver1 semver2))))))))
+                             (and (or (not yanked1) yanked2)
+                                  (or (not (eq? yanked1 yanked2))
+                                      (semver>? semver1 semver2))))))))
       (and (not (eq? #f version))
            (match-let (((semver yanked) version))
              (list (semver->string semver) yanked)))))

base-commit: 986245daca2fb50d58cf0f2b9273f0d670d38af2
-- 
2.47.1