guix-commits
[Top][All Lists]
Advanced

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

01/01: store: 'build-things' now supports older daemon protocols.


From: Ludovic Courtès
Subject: 01/01: store: 'build-things' now supports older daemon protocols.
Date: Fri, 04 Dec 2015 09:36:11 +0000

civodul pushed a commit to branch master
in repository guix.

commit 2734cbb89598dbd212d598800bef5a1e649f71f7
Author: Ludovic Courtès <address@hidden>
Date:   Fri Dec 4 11:32:50 2015 +0200

    store: 'build-things' now supports older daemon protocols.
    
    This is a followup to d203d3d.
    
    * guix/store.scm (build-things): Add 'build/old'.  Use it when STORE's
    minor version is less than 15.
---
 guix/store.scm |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/guix/store.scm b/guix/store.scm
index 1818187..98ccbd1 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -648,13 +648,22 @@ bits are kept.  HASH-ALGO must be a string such as 
\"sha256\"."
   (let ((build (operation (build-things (string-list things)
                                         (integer mode))
                           "Do it!"
-                          boolean)))
+                          boolean))
+        (build/old (operation (build-things (string-list things))
+                              "Do it!"
+                              boolean)))
     (lambda* (store things #:optional (mode (build-mode normal)))
       "Build THINGS, a list of store items which may be either '.drv' files or
 outputs, and return when the worker is done building them.  Elements of THINGS
 that are not derivations can only be substituted and not built locally.
 Return #t on success."
-      (build store things mode))))
+      (if (>= (nix-server-minor-version store) 15)
+          (build store things mode)
+          (if (= mode (build-mode normal))
+              (build/old store things)
+              (raise (condition (&nix-protocol-error
+                                 (message "unsupported build mode")
+                                 (status  1)))))))))
 
 (define-operation (add-temp-root (store-path path))
   "Make PATH a temporary root for the duration of the current session.



reply via email to

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