guix-commits
[Top][All Lists]
Advanced

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

02/03: check-available-binaries: Use 'with-store'.


From: Ludovic Courtès
Subject: 02/03: check-available-binaries: Use 'with-store'.
Date: Wed, 14 Jan 2015 17:53:59 +0000

civodul pushed a commit to branch core-updates
in repository guix.

commit 619c9522b2d6d7c451f90524c3a041c5fb12c28e
Author: Ludovic Courtès <address@hidden>
Date:   Wed Jan 14 18:20:01 2015 +0100

    check-available-binaries: Use 'with-store'.
    
    * build-aux/check-available-binaries.scm: Use 'with-store' instead of an
      explicit 'open-connection'.
---
 build-aux/check-available-binaries.scm |   48 ++++++++++++++++----------------
 1 files changed, 24 insertions(+), 24 deletions(-)

diff --git a/build-aux/check-available-binaries.scm 
b/build-aux/check-available-binaries.scm
index 74a43ff..ebe94d2 100644
--- a/build-aux/check-available-binaries.scm
+++ b/build-aux/check-available-binaries.scm
@@ -28,28 +28,28 @@
              (srfi srfi-1)
              (srfi srfi-26))
 
-(let* ((store  (open-connection))
-       (native (append-map (lambda (system)
-                             (map (cut package-derivation store <> system)
-                                  (list %bootstrap-tarballs emacs)))
-                           %supported-systems))
-       (cross  (map (cut package-cross-derivation store
-                         %bootstrap-tarballs <>)
-                    '("mips64el-linux-gnuabi64")))
-       (total  (append native cross)))
-  (define (warn proc)
-    (lambda (drv)
-      (or (proc drv)
-          (begin
-            (format (current-error-port) "~a is not substitutable~%"
-                    drv)
-            #f))))
+(with-store store
+  (let* ((native (append-map (lambda (system)
+                               (map (cut package-derivation store <> system)
+                                    (list %bootstrap-tarballs emacs)))
+                             %supported-systems))
+         (cross  (map (cut package-cross-derivation store
+                           %bootstrap-tarballs <>)
+                      '("mips64el-linux-gnuabi64")))
+         (total  (append native cross)))
+    (define (warn proc)
+      (lambda (drv)
+        (or (proc drv)
+            (begin
+              (format (current-error-port) "~a is not substitutable~%"
+                      drv)
+              #f))))
 
-  (set-build-options store #:use-substitutes? #t)
-  (let ((result (every (compose (warn (cut has-substitutes? store <>))
-                                derivation->output-path)
-                       total)))
-    (when result
-      (format (current-error-port) "~a packages found substitutable~%"
-              (length total)))
-    (exit result)))
+    (set-build-options store #:use-substitutes? #t)
+    (let ((result (every (compose (warn (cut has-substitutes? store <>))
+                                  derivation->output-path)
+                         total)))
+      (when result
+        (format (current-error-port) "~a packages found substitutable~%"
+                (length total)))
+      (exit result))))



reply via email to

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