[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
04/05: ui: Add 'show-derivation-outputs'.
From: |
Alex Kost |
Subject: |
04/05: ui: Add 'show-derivation-outputs'. |
Date: |
Fri, 18 Sep 2015 18:45:47 +0000 |
alezost pushed a commit to branch master
in repository guix.
commit fa394eb99ce3830059e0c7d4d488f63c4887bcd0
Author: Alex Kost <address@hidden>
Date: Thu Jul 23 16:08:39 2015 +0300
ui: Add 'show-derivation-outputs'.
* guix/scripts/build.scm (guix-build): Extract code from here and move to...
* guix/ui.scm (show-derivation-outputs): ... here. New procedure.
---
guix/scripts/build.scm | 9 +--------
guix/ui.scm | 9 +++++++++
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index 1d766c0..a357cf8 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -538,14 +538,7 @@ arguments with packages that use the specified source."
roots))
((not (assoc-ref opts 'dry-run?))
(and (build-derivations store drv)
- (for-each (lambda (d)
- (format #t "~{~a~%~}"
- (map (match-lambda
- ((out-name . out)
- (derivation->output-path
- d out-name)))
- (derivation-outputs d))))
- drv)
+ (for-each show-derivation-outputs drv)
(for-each (cut register-root store <> <>)
(map (lambda (drv)
(map cdr
diff --git a/guix/ui.scm b/guix/ui.scm
index e028e40..4a3630f 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -62,6 +62,7 @@
show-bug-report-information
string->number*
size->number
+ show-derivation-outputs
show-what-to-build
show-what-to-build*
show-manifest-transaction
@@ -502,6 +503,14 @@ error."
(leave (_ "expression ~s does not evaluate to a package~%")
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))))
+
(define* (show-what-to-build store drv
#:key dry-run? (use-substitutes? #t))
"Show what will or would (depending on DRY-RUN?) be built in realizing the