From patchwork Mon Nov 26 21:47:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 325 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 8951A1681C; Mon, 26 Nov 2018 21:48:13 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) by mira.cbaines.net (Postfix) with ESMTPS id 398D5167E5 for ; Mon, 26 Nov 2018 21:48:13 +0000 (GMT) Received: from localhost ([::1]:39000 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gROjk-0005Fe-FV for patchwork@mira.cbaines.net; Mon, 26 Nov 2018 16:48:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56216) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gROjb-00051d-VK for guix-patches@gnu.org; Mon, 26 Nov 2018 16:48:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gROjb-0005RP-4V for guix-patches@gnu.org; Mon, 26 Nov 2018 16:48:03 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:45953) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gROjb-0005RL-1u for guix-patches@gnu.org; Mon, 26 Nov 2018 16:48:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gROjb-0004pa-0H for guix-patches@gnu.org; Mon, 26 Nov 2018 16:48:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#33519] [PATCH 4/4] ui: 'show-what-to-build' reports grafts separately. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 26 Nov 2018 21:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33519 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 33519@debbugs.gnu.org Received: via spool by 33519-submit@debbugs.gnu.org id=B33519.154326885018510 (code B ref 33519); Mon, 26 Nov 2018 21:48:02 +0000 Received: (at 33519) by debbugs.gnu.org; 26 Nov 2018 21:47:30 +0000 Received: from localhost ([127.0.0.1]:50207 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gROj4-0004oO-CH for submit@debbugs.gnu.org; Mon, 26 Nov 2018 16:47:30 -0500 Received: from eggs.gnu.org ([208.118.235.92]:46260) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gROj2-0004nm-6H for 33519@debbugs.gnu.org; Mon, 26 Nov 2018 16:47:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gROiw-00057g-39 for 33519@debbugs.gnu.org; Mon, 26 Nov 2018 16:47:23 -0500 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58123) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gROiu-00056n-6i; Mon, 26 Nov 2018 16:47:20 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=53792 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1gROit-0000yM-Vb; Mon, 26 Nov 2018 16:47:20 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 26 Nov 2018 22:47:09 +0100 Message-Id: <20181126214709.27856-4-ludo@gnu.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181126214709.27856-1-ludo@gnu.org> References: <20181126214709.27856-1-ludo@gnu.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: rekado@elephly.net Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * guix/ui.scm (graft-derivation?): New procedure. (show-what-to-build): Distinguish among BUILD derivations that match 'graft-derivation?'. Report them separately. --- guix/ui.scm | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/guix/ui.scm b/guix/ui.scm index 96f403acf5..60636edac0 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -816,6 +816,12 @@ warning." (warning (G_ "at least ~,1h MB needed but only ~,1h MB available in ~a~%") (/ need 1e6) (/ free 1e6) directory)))) +(define (graft-derivation? drv) + "Return true if DRV is definitely a graft derivation, false otherwise." + (match (assq-ref (derivation-properties drv) 'type) + ('graft #t) + (_ #f))) + (define* (show-what-to-build store drv #:key dry-run? (use-substitutes? #t) (mode (build-mode normal))) @@ -865,7 +871,11 @@ report what is prerequisites are available for download." (append-map substitutable-references download)))) - download))) + download)) + ((graft build) + (partition (compose graft-derivation? + read-derivation-from-file) + build))) (define installed-size (reduce + 0 (map substitutable-nar-size download))) @@ -898,7 +908,12 @@ report what is prerequisites are available for download." "~:[The following files would be downloaded:~%~{ ~a~%~}~;~]" (length download)) (null? download) - (map substitutable-path download)))) + (map substitutable-path download))) + (format (current-error-port) + (N_ "~:[The following graft would be made:~%~{ ~a~%~}~;~]" + "~:[The following grafts would be made:~%~{ ~a~%~}~;~]" + (length graft)) + (null? graft) graft)) (begin (format (current-error-port) (N_ "~:[The following derivation will be built:~%~{ ~a~%~}~;~]" @@ -918,7 +933,12 @@ report what is prerequisites are available for download." "~:[The following files will be downloaded:~%~{ ~a~%~}~;~]" (length download)) (null? download) - (map substitutable-path download))))) + (map substitutable-path download))) + (format (current-error-port) + (N_ "~:[The following graft will be made:~%~{ ~a~%~}~;~]" + "~:[The following grafts will be made:~%~{ ~a~%~}~;~]" + (length graft)) + (null? graft) graft))) (check-available-space installed-size)