diff options
author | Mark H Weaver <mhw@netris.org> | 2014-07-27 20:15:50 -0400 |
---|---|---|
committer | Mark H Weaver <mhw@netris.org> | 2014-07-27 20:15:50 -0400 |
commit | 33690ffde5af2c516bc6b2dd060ab9cf7ab88eb2 (patch) | |
tree | d91daca5084dec6ede304d2c9ff1c376a740e416 /guix/monads.scm | |
parent | 5c47b06b4370e7d6590b0c75404d694a52897293 (diff) | |
parent | b9663471a87916f36b50af2a0f885f6f08dc3ed2 (diff) |
Merge branch 'master' into core-updates
Diffstat (limited to 'guix/monads.scm')
-rw-r--r-- | guix/monads.scm | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/guix/monads.scm b/guix/monads.scm index c2c6f1a03d..4af2b704ab 100644 --- a/guix/monads.scm +++ b/guix/monads.scm @@ -55,6 +55,7 @@ run-with-store text-file text-file* + interned-file package-file origin->derivation package->derivation @@ -362,6 +363,18 @@ and store file names; the resulting store file holds references to all these." (derivation-expression name (builder inputs) #:inputs inputs))) +(define* (interned-file file #:optional name + #:key (recursive? #t)) + "Return the name of FILE once interned in the store. Use NAME as its store +name, or the basename of FILE if NAME is omitted. + +When RECURSIVE? is true, the contents of FILE are added recursively; if FILE +designates a flat file and RECURSIVE? is true, its contents are added, and its +permission bits are kept." + (lambda (store) + (add-to-store store (or name (basename file)) + recursive? "sha256" file))) + (define* (package-file package #:optional file #:key (system (%current-system)) (output "out")) |