aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-12-04 11:32:50 +0200
committerLudovic Courtès <ludo@gnu.org>2015-12-04 11:34:18 +0200
commit2734cbb89598dbd212d598800bef5a1e649f71f7 (patch)
tree06c2af299209ad0065b6d2d19852ddf216642018
parent07e70f4846521c1fa5319b25f23eea171a03fccd (diff)
downloadpatches-2734cbb89598dbd212d598800bef5a1e649f71f7.tar
patches-2734cbb89598dbd212d598800bef5a1e649f71f7.tar.gz
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.
-rw-r--r--guix/store.scm13
1 files changed, 11 insertions, 2 deletions
diff --git a/guix/store.scm b/guix/store.scm
index 1818187155..98ccbd1004 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.