aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-06-23 18:46:53 +0200
committerLudovic Courtès <ludo@gnu.org>2019-06-27 11:14:42 +0200
commit08c95ba28d5d5c9c96f6d1bdcfb75a04e5177a74 (patch)
tree3ddb9578b06846a02cefb4f01fe2af422ade2faa
parentd38d4ffa10d74e361e15e18d04898eb5af3fb2eb (diff)
downloadguix-08c95ba28d5d5c9c96f6d1bdcfb75a04e5177a74.tar.gz
guix-08c95ba28d5d5c9c96f6d1bdcfb75a04e5177a74.zip
ui: 'show-derivation-outputs' accepts <derivation-input> records.
* guix/ui.scm (show-derivation-outputs): Handle <derivation-input> records.
-rw-r--r--guix/ui.scm19
1 files changed, 13 insertions, 6 deletions
diff --git a/guix/ui.scm b/guix/ui.scm
index 630afa47bf..6d243ef041 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -777,12 +777,19 @@ error."
str))))
(define (show-derivation-outputs derivation)
- "Show the output file names of DERIVATION."
- (format #t "~{~a~%~}"
- (map (match-lambda
- ((out-name . out)
- (derivation->output-path derivation out-name)))
- (derivation-outputs derivation))))
+ "Show the output file names of DERIVATION, which can be a derivation or a
+derivation input."
+ (define (show-outputs derivation outputs)
+ (format #t "~{~a~%~}"
+ (map (cut derivation->output-path derivation <>)
+ outputs)))
+
+ (match derivation
+ ((? derivation?)
+ (show-outputs derivation (derivation-output-names derivation)))
+ ((? derivation-input? input)
+ (show-outputs (derivation-input-derivation input)
+ (derivation-input-sub-derivations input)))))
(define* (check-available-space need
#:optional (directory (%store-prefix)))