From: "Ludovic Courtès" <ludo@gnu.org>
To: 40149@debbugs.gnu.org
Cc: "Ludovic Courtès" <ludo@gnu.org>
Subject: [bug#40149] [PATCH 3/5] deploy: Show what machines will be deployed.
Date: Fri, 20 Mar 2020 15:09:08 +0100 [thread overview]
Message-ID: <20200320140910.28439-3-ludo@gnu.org> (raw)
In-Reply-To: <20200320140910.28439-1-ludo@gnu.org>
* guix/scripts/deploy.scm (show-what-to-deploy): New procedure.
(guix-deploy): Call it.
---
guix/scripts/deploy.scm | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/guix/scripts/deploy.scm b/guix/scripts/deploy.scm
index ad05c333dc..1f1ca58476 100644
--- a/guix/scripts/deploy.scm
+++ b/guix/scripts/deploy.scm
@@ -1,6 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2019 David Thompson <davet@gnu.org>
;;; Copyright © 2019 Jakob L. Kreuze <zerodaysfordays@sdf.org>
+;;; Copyright © 2020 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -97,6 +98,22 @@ Perform the deployment specified by FILE.\n"))
environment-modules))))
(load* file module)))
+(define (show-what-to-deploy machines)
+ "Show the list of machines to deploy, MACHINES."
+ (let ((count (length machines)))
+ (format (current-error-port)
+ (N_ "The following ~*machine will be deployed:~%"
+ "The following ~d machines will be deployed:~%"
+ count)
+ count)
+ (display (indented-string
+ (fill-paragraph (string-join (map machine-display-name machines)
+ ", ")
+ (- (%text-width) 2) 2)
+ 2)
+ (current-error-port))
+ (display "\n\n" (current-error-port))))
+
(define (guix-deploy . args)
(define (handle-argument arg result)
(alist-cons 'file arg result))
@@ -105,6 +122,8 @@ Perform the deployment specified by FILE.\n"))
#:argument-handler handle-argument))
(file (assq-ref opts 'file))
(machines (or (and file (load-source-file file)) '())))
+ (show-what-to-deploy machines)
+
(with-status-verbosity (assoc-ref opts 'verbosity)
(with-store store
(set-build-options-from-command-line store opts)
--
2.25.1
next prev parent reply other threads:[~2020-03-20 14:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-20 14:04 [bug#40149] [PATCH 0/5] Assorted 'guix deploy' improvements Ludovic Courtès
2020-03-20 14:09 ` [bug#40149] [PATCH 1/5] machine: ssh: Make sanity checks in a single round trip Ludovic Courtès
2020-03-20 14:09 ` [bug#40149] [PATCH 2/5] ui: Add 'indented-string' Ludovic Courtès
2020-03-20 14:09 ` Ludovic Courtès [this message]
2020-03-20 14:09 ` [bug#40149] [PATCH 4/5] deploy: Write a message upon successful deployment Ludovic Courtès
2020-03-20 14:09 ` [bug#40149] [PATCH 5/5] machine: ssh: Better report missing initrd modules Ludovic Courtès
2020-03-23 9:49 ` bug#40149: [PATCH 0/5] Assorted 'guix deploy' improvements Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200320140910.28439-3-ludo@gnu.org \
--to=ludo@gnu.org \
--cc=40149@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).