From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: [PATCH 5/7] ui: Add 'show-derivation-outputs'. Date: Sat, 25 Jul 2015 11:49:55 +0300 Message-ID: <1437814197-6321-6-git-send-email-alezost@gmail.com> References: <1437814197-6321-1-git-send-email-alezost@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53457) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZIvAC-0004Td-UG for guix-devel@gnu.org; Sat, 25 Jul 2015 04:50:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZIvAB-00054M-It for guix-devel@gnu.org; Sat, 25 Jul 2015 04:50:36 -0400 Received: from mail-la0-x230.google.com ([2a00:1450:4010:c03::230]:33860) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZIvAB-00053U-1u for guix-devel@gnu.org; Sat, 25 Jul 2015 04:50:35 -0400 Received: by lafd3 with SMTP id d3so15320137laf.1 for ; Sat, 25 Jul 2015 01:50:34 -0700 (PDT) In-Reply-To: <1437814197-6321-1-git-send-email-alezost@gmail.com> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org Cc: Alex Kost * 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 ;;; Copyright © 2013 Mark H Weaver ;;; Copyright © 2013 Nikita Karetnikov -;;; Copyright © 2014 Alex Kost +;;; Copyright © 2014, 2015 Alex Kost ;;; Copyright © 2014 Deck Pickard ;;; ;;; 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