[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/02: store: Add optional 'references' parameter to 'text-file'.
From: |
Ludovic Courtès |
Subject: |
01/02: store: Add optional 'references' parameter to 'text-file'. |
Date: |
Thu, 12 Feb 2015 22:44:51 +0000 |
civodul pushed a commit to branch master
in repository guix.
commit ad3729536ab4fe233b32017ac889f026a4bad43e
Author: Ludovic Courtès <address@hidden>
Date: Wed Feb 11 22:58:53 2015 +0100
store: Add optional 'references' parameter to 'text-file'.
* guix/store.scm (text-file): Add optional 'references' parameter. Pass
it to 'add-text-to-store'.
* doc/guix.texi (The Store Monad): Adjust accordingly.
---
doc/guix.texi | 5 +++--
guix/store.scm | 8 +++++---
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index 0c6b1e4..04b9b4a 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -2358,9 +2358,10 @@ Run @var{mval}, a monadic value in the store monad, in
@var{store}, an
open store connection.
@end deffn
address@hidden {Monadic Procedure} text-file @var{name} @var{text}
address@hidden {Monadic Procedure} text-file @var{name} @var{text}
address@hidden
Return as a monadic value the absolute file name in the store of the file
-containing @var{text}, a string.
+containing @var{text}, a string. @var{references} is a list of store items
that the
+resulting text file refers to; it defaults to the empty list.
@end deffn
@deffn {Monadic Procedure} interned-file @var{file} address@hidden @
diff --git a/guix/store.scm b/guix/store.scm
index 02d84eb..d88fb3e 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -890,11 +890,13 @@ taking the store as its first argument."
;; Store monad operators.
;;
-(define* (text-file name text)
+(define* (text-file name text
+ #:optional (references '()))
"Return as a monadic value the absolute file name in the store of the file
-containing TEXT, a string."
+containing TEXT, a string. REFERENCES is a list of store items that the
+resulting text file refers to; it defaults to the empty list."
(lambda (store)
- (values (add-text-to-store store name text '())
+ (values (add-text-to-store store name text references)
store)))
(define* (interned-file file #:optional name