guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 5/7] ui: Add 'show-derivation-outputs'.


From: Alex Kost
Subject: [PATCH 5/7] ui: Add 'show-derivation-outputs'.
Date: Sat, 25 Jul 2015 11:49:55 +0300

* 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            | 11 ++++++++++-
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index d593b5a..f169853 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -490,14 +490,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 28d4b97..f17eae9 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <address@hidden>
 ;;; Copyright © 2013 Mark H Weaver <address@hidden>
 ;;; Copyright © 2013 Nikita Karetnikov <address@hidden>
-;;; Copyright © 2014 Alex Kost <address@hidden>
+;;; Copyright © 2014, 2015 Alex Kost <address@hidden>
 ;;; Copyright © 2014 Deck Pickard <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -57,6 +57,7 @@
             show-bug-report-information
             string->number*
             size->number
+            show-derivation-outputs
             show-what-to-build
             show-what-to-build*
             show-manifest-transaction
@@ -489,6 +490,14 @@ error."
      (leave (_ "expression ~s does not evaluate to a package~%")
             str))))
 
+(define (show-derivation-outputs derivation)
+  "Show outputs 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
-- 
2.4.3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]