summaryrefslogtreecommitdiff
path: root/guix/store.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-05-17 00:08:39 +0200
committerLudovic Courtès <ludo@gnu.org>2014-05-17 00:08:39 +0200
commite901ef297d9afe9a159dcf2bbd9779c9fbf822be (patch)
tree9783b2af58130ccc48de3f97e1bd3bcc5aa12bc0 /guix/store.scm
parent87a52da7d0da82bd8df9c86dcac7029c375b50c0 (diff)
downloadguix-patches-e901ef297d9afe9a159dcf2bbd9779c9fbf822be.tar
guix-patches-e901ef297d9afe9a159dcf2bbd9779c9fbf822be.tar.gz
store: Add #:store parameter to 'register-path'.
* guix/store.scm (register-path): Add #:store and honor it.
Diffstat (limited to 'guix/store.scm')
-rw-r--r--guix/store.scm12
1 files changed, 8 insertions, 4 deletions
diff --git a/guix/store.scm b/guix/store.scm
index 2b924db213..1731c14f27 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -797,17 +797,21 @@ signing them if SIGN? is true."
(loop tail)))))))
(define* (register-path path
- #:key (references '()) deriver)
+ #:key (references '()) deriver store)
"Register PATH as a valid store file, with REFERENCES as its list of
-references, and DERIVER as its deriver (.drv that led to it.) Return #t on
-success.
+references, and DERIVER as its deriver (.drv that led to it.) If STORE is not
+#f, it must be a string denoting the directory name of the new store to
+initialize. Return #t on success.
Use with care as it directly modifies the store! This is primarily meant to
be used internally by the daemon's build hook."
;; Currently this is implemented by calling out to the fine C++ blob.
(catch 'system-error
(lambda ()
- (let ((pipe (open-pipe* OPEN_WRITE %guix-register-program)))
+ (let ((pipe (apply open-pipe* OPEN_WRITE %guix-register-program
+ (if store
+ `("--prefix" ,store)
+ '()))))
(and pipe
(begin
(format pipe "~a~%~a~%~a~%"