diff options
author | Jan Nieuwenhuizen <janneke@gnu.org> | 2018-07-10 19:00:48 +0200 |
---|---|---|
committer | Jan Nieuwenhuizen <janneke@gnu.org> | 2018-07-12 06:22:04 +0200 |
commit | f3a422511f793fb6c6cfeec2bb8735965a03294a (patch) | |
tree | 118a6969c6b95b652e50d7c5f43b34743c729f04 /guix | |
parent | 66413378e8eb68ebcfeb1e2f4154a4443dfa21ca (diff) | |
download | gnu-guix-f3a422511f793fb6c6cfeec2bb8735965a03294a.tar gnu-guix-f3a422511f793fb6c6cfeec2bb8735965a03294a.tar.gz |
store: Add `binary-file'.
* guix/store.scm (binary-file): New function.
* doc/guix.texi (The Store Monad): Describe binary-file.
Diffstat (limited to 'guix')
-rw-r--r-- | guix/store.scm | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/guix/store.scm b/guix/store.scm index bac42f2738..cc5c24a77d 100644 --- a/guix/store.scm +++ b/guix/store.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2018 Jan Nieuwenhuizen <janneke@gnu.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -77,6 +78,7 @@ add-data-to-store add-text-to-store add-to-store + binary-file build-things build query-failed-paths @@ -1362,7 +1364,18 @@ taking the store as its first argument." ;; Store monad operators. ;; -(define* (text-file name text +(define* (binary-file name + data ;bytevector + #:optional (references '())) + "Return as a monadic value the absolute file name in the store of the file +containing DATA, a bytevector. REFERENCES is a list of store items that the +resulting text file refers to; it defaults to the empty list." + (lambda (store) + (values (add-data-to-store store name data references) + store))) + +(define* (text-file name + text ;string #:optional (references '())) "Return as a monadic value the absolute file name in the store of the file containing TEXT, a string. REFERENCES is a list of store items that the |