summaryrefslogtreecommitdiff
path: root/guix/derivations.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-06-23 11:46:17 +0200
committerLudovic Courtès <ludo@gnu.org>2019-06-27 11:14:41 +0200
commitc89985d91d2b44704fbcaebd7a097dee0c0e3e4a (patch)
treee4526f0321de2b397eaad258ce8a7be5e28c6362 /guix/derivations.scm
parent4311cf965c978c7865c03349c82110b241f8ff23 (diff)
derivations: Add 'derivation-input'.
* guix/derivations.scm (derivation-input): New procedure. * tests/grafts.scm (make-derivation-input): Remove. ("graft-derivation, unused outputs not depended on"): Use 'derivation-input'.
Diffstat (limited to 'guix/derivations.scm')
-rw-r--r--guix/derivations.scm8
1 files changed, 8 insertions, 0 deletions
diff --git a/guix/derivations.scm b/guix/derivations.scm
index 8145d51143..4df7b06181 100644
--- a/guix/derivations.scm
+++ b/guix/derivations.scm
@@ -157,6 +157,14 @@
"Return the <derivation> object INPUT refers to."
(read-derivation-from-file (derivation-input-path input)))
+(define* (derivation-input drv #:optional
+ (outputs (derivation-output-names drv)))
+ "Return a <derivation-input> for the OUTPUTS of DRV."
+ ;; This is a public interface meant to be more convenient than
+ ;; 'make-derivation-input' and giving us more control.
+ (make-derivation-input (derivation-file-name drv)
+ outputs))
+
(set-record-type-printer! <derivation>
(lambda (drv port)
(format port "#<derivation ~a => ~a ~a>"