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'.
This commit is contained in:
Ludovic Courtès 2019-06-23 11:46:17 +02:00
parent 4311cf965c
commit c89985d91d
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
2 changed files with 12 additions and 12 deletions

View file

@ -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>"