guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/03: channels: Simplify 'channel-instances->manifest'.


From: guix-commits
Subject: 01/03: channels: Simplify 'channel-instances->manifest'.
Date: Sat, 6 Jul 2019 10:17:32 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit d9e6217f4e978777d1e6f7b82a1e096740cc419a
Author: Ludovic Courtès <address@hidden>
Date:   Sat Jul 6 15:54:45 2019 +0200

    channels: Simplify 'channel-instances->manifest'.
    
    * guix/channels.scm (channel-instances->manifest)[instance->entry]:
    Change to take two arguments instead of a tuple.  Turn into a
    non-monadic procedure.
    Call it via 'map' instead of 'mapm'.
---
 guix/channels.scm | 43 +++++++++++++++++++------------------------
 1 file changed, 19 insertions(+), 24 deletions(-)

diff --git a/guix/channels.scm b/guix/channels.scm
index e7278c6..fcf9fed 100644
--- a/guix/channels.scm
+++ b/guix/channels.scm
@@ -429,32 +429,27 @@ derivation."
 (define (channel-instances->manifest instances)
   "Return a profile manifest with entries for all of INSTANCES, a list of
 channel instances."
-  (define instance->entry
-    (match-lambda
-      ((instance drv)
-       (let ((commit  (channel-instance-commit instance))
-             (channel (channel-instance-channel instance)))
-         (with-monad %store-monad
-           (return (manifest-entry
-                     (name (symbol->string (channel-name channel)))
-                     (version (string-take commit 7))
-                     (item (if (guix-channel? channel)
-                               (if (old-style-guix? drv)
-                                   (whole-package-for-legacy
-                                    (string-append name "-" version)
-                                    drv)
-                                   drv)
-                               drv))
-                     (properties
-                      `((source (repository
-                                 (version 0)
-                                 (url ,(channel-url channel))
-                                 (branch ,(channel-branch channel))
-                                 (commit ,commit))))))))))))
+  (define (instance->entry instance drv)
+    (let ((commit  (channel-instance-commit instance))
+          (channel (channel-instance-channel instance)))
+      (manifest-entry
+        (name (symbol->string (channel-name channel)))
+        (version (string-take commit 7))
+        (item (if (guix-channel? channel)
+                  (if (old-style-guix? drv)
+                      (whole-package-for-legacy (string-append name "-" 
version)
+                                                drv)
+                      drv)
+                  drv))
+        (properties
+         `((source (repository
+                    (version 0)
+                    (url ,(channel-url channel))
+                    (branch ,(channel-branch channel))
+                    (commit ,commit))))))))
 
   (mlet* %store-monad ((derivations (channel-instance-derivations instances))
-                       (entries     (mapm %store-monad instance->entry
-                                          (zip instances derivations))))
+                       (entries ->  (map instance->entry instances 
derivations)))
     (return (manifest entries))))
 
 (define (package-cache-file manifest)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]