guix-commits
[Top][All Lists]
Advanced

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

03/03: substitute-binary: Let the user know when the cache is being upda


From: Ludovic Courtès
Subject: 03/03: substitute-binary: Let the user know when the cache is being updated.
Date: Mon, 26 Jan 2015 20:58:24 +0000

civodul pushed a commit to branch master
in repository guix.

commit 3bcfe23cfcb17e4495020fce7744a68c2daaf5fb
Author: Ludovic Courtès <address@hidden>
Date:   Mon Jan 26 21:57:06 2015 +0100

    substitute-binary: Let the user know when the cache is being updated.
    
    * guix/scripts/substitute-binary.scm (open-cache*): New macro.
      (guix-substitute-binary): Use it instead of (delay (open-cache ...)).
---
 guix/scripts/substitute-binary.scm |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/guix/scripts/substitute-binary.scm 
b/guix/scripts/substitute-binary.scm
index 09b917f..903564c 100755
--- a/guix/scripts/substitute-binary.scm
+++ b/guix/scripts/substitute-binary.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014 Ludovic Courtès <address@hidden>
+;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <address@hidden>
 ;;; Copyright © 2014 Nikita Karetnikov <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -213,6 +213,15 @@ failure."
                           (cut %make-cache url <...>)
                           '("StoreDir" "WantMassQuery")))))
 
+(define-syntax-rule (open-cache* url)
+  "Delayed variant of 'open-cache' that also lets the user know that they're
+gonna have to wait."
+  (delay (begin
+           (format (current-error-port)
+                   (_ "updating list of substitutes from '~a'...~%")
+                   url)
+           (open-cache url))))
+
 (define-record-type <narinfo>
   (%make-narinfo path uri uri-base compression file-hash file-size nar-hash 
nar-size
                  references deriver system signature contents)
@@ -668,7 +677,7 @@ substituter disabled~%")
    (with-error-handling                           ; for signature errors
      (match args
        (("--query")
-        (let ((cache (delay (open-cache %cache-url)))
+        (let ((cache (open-cache* %cache-url))
               (acl   (current-acl)))
           (define (valid? obj)
             (and (narinfo? obj) (valid-narinfo? obj acl)))
@@ -719,7 +728,7 @@ substituter disabled~%")
                   (loop (read-line)))))))
        (("--substitute" store-path destination)
         ;; Download STORE-PATH and add store it as a Nar in file DESTINATION.
-        (let* ((cache   (delay (open-cache %cache-url)))
+        (let* ((cache   (open-cache* %cache-url))
                (narinfo (lookup-narinfo cache store-path))
                (uri     (narinfo-uri narinfo)))
           ;; Make sure it is signed and everything.



reply via email to

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