From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:34676) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jEsy9-0007mB-K1 for guix-patches@gnu.org; Thu, 19 Mar 2020 07:04:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jEsy4-0001mn-KT for guix-patches@gnu.org; Thu, 19 Mar 2020 07:04:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:35870) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jEsy4-0001l3-6Q for guix-patches@gnu.org; Thu, 19 Mar 2020 07:04:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jEsy4-0000QU-2i for guix-patches@gnu.org; Thu, 19 Mar 2020 07:04:04 -0400 Subject: [bug#40130] [PATCH 5/8] deploy: Use 'with-build-handler'. Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Thu, 19 Mar 2020 12:02:49 +0100 Message-Id: <20200319110252.5081-5-ludo@gnu.org> In-Reply-To: <20200319110252.5081-1-ludo@gnu.org> References: <20200319110252.5081-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: 40130@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= Until now, 'guix deploy' would never display what is going to be built. * guix/scripts/deploy.scm (guix-deploy): Wrap 'for-each' in 'with-build-handler'. --- guix/scripts/deploy.scm | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/guix/scripts/deploy.scm b/guix/scripts/deploy.scm index ad05c333dc..a82dde00a4 100644 --- a/guix/scripts/deploy.scm +++ b/guix/scripts/deploy.scm @@ -108,19 +108,21 @@ Perform the deployment specified by FILE.\n")) (with-status-verbosity (assoc-ref opts 'verbosity) (with-store store (set-build-options-from-command-line store opts) - (for-each (lambda (machine) - (info (G_ "deploying to ~a...~%") - (machine-display-name machine)) - (parameterize ((%graft? (assq-ref opts 'graft?))) - (guard (c ((message-condition? c) - (report-error (G_ "failed to deploy ~a: ~a~%") - (machine-display-name machine) - (condition-message c))) - ((deploy-error? c) - (when (deploy-error-should-roll-back c) - (info (G_ "rolling back ~a...~%") - (machine-display-name machine)) - (run-with-store store (roll-back-machine machine))) - (apply throw (deploy-error-captured-args c)))) - (run-with-store store (deploy-machine machine))))) - machines))))) + (with-build-handler (build-notifier #:use-substitutes? + (assoc-ref opts 'substitutes?)) + (for-each (lambda (machine) + (info (G_ "deploying to ~a...~%") + (machine-display-name machine)) + (parameterize ((%graft? (assq-ref opts 'graft?))) + (guard (c ((message-condition? c) + (report-error (G_ "failed to deploy ~a: ~a~%") + (machine-display-name machine) + (condition-message c))) + ((deploy-error? c) + (when (deploy-error-should-roll-back c) + (info (G_ "rolling back ~a...~%") + (machine-display-name machine)) + (run-with-store store (roll-back-machine machine))) + (apply throw (deploy-error-captured-args c)))) + (run-with-store store (deploy-machine machine))))) + machines)))))) -- 2.25.1