GNU bug report logs - #73833
[PATCH] guix: import: composer: Improve composer-fetch.

Previous Next

Package: guix-patches;

Reported by: Nicolas Graves <ngraves <at> ngraves.fr>

Date: Wed, 16 Oct 2024 05:31:02 UTC

Severity: normal

Tags: patch

Full log


View this message in rfc822 format

From: Nicolas Graves <ngraves <at> ngraves.fr>
To: 73833 <at> debbugs.gnu.org
Cc: Nicolas Graves <ngraves <at> ngraves.fr>
Subject: [bug#73833] [PATCH v2 4/5] guix: refresh: Keep the version field of each update specification.
Date: Fri, 18 Oct 2024 00:26:00 +0200
* guix/scripts/refresh.scm (options->update-specs)[update-specs]: Keep
the version field of each update specification.  This is done using a
variable to cache package names and then filter out unwanted candidates.
---
 guix/scripts/refresh.scm | 23 +++++++++++++++++------
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm
index ec7d38c22a..810c33c786 100644
--- a/guix/scripts/refresh.scm
+++ b/guix/scripts/refresh.scm
@@ -310,12 +310,23 @@ (define update-specs
        some)))
 
   (if (assoc-ref opts 'recursive?)
-      (mlet* %store-monad ((edges (node-edges %bag-node-type (all-packages)))
-                           (packages -> (node-transitive-edges
-                                         (map update-spec-package update-specs)
-                                         edges)))
-        ;; FIXME: The 'version' field of each update spec is lost.
-        (return (map update-spec packages)))
+      (mlet* %store-monad
+          ((edges (node-edges %bag-node-type (all-packages)))
+           (strict-spec-pkgs -> (map update-spec-package update-specs))
+           (strict-spec-pkg-names -> (map package-name strict-spec-pkgs))
+           (packages -> (node-transitive-edges strict-spec-pkgs edges))
+           (transitive-specs -> (map update-spec packages)))
+        (return (append update-specs
+                        (filter-map (match-lambda
+                                      ((? update? spec)
+                                       (if (member (package-name
+                                                    (update-spec-package spec))
+                                                   strict-spec-pkg-names)
+                                           spec
+                                           #f))
+                                      (_
+                                       #f))
+                                    transitive-specs))))
       (with-monad %store-monad
         (return update-specs))))
 
-- 
2.46.0





This bug report was last modified 198 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.