From mboxrd@z Thu Jan 1 00:00:00 1970 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 Subject: [bug#33519] [PATCH 4/4] ui: 'show-what-to-build' reports grafts separately. Resent-Message-ID: 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> In-Reply-To: <20181126214709.27856-1-ludo@gnu.org> References: <20181126214709.27856-1-ludo@gnu.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 33519@debbugs.gnu.org Cc: rekado@elephly.net * 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) -- 2.19.1