guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

04/06: reconfigure: Use 'formatted-message'.


From: guix-commits
Subject: 04/06: reconfigure: Use 'formatted-message'.
Date: Fri, 25 Jun 2021 09:12:50 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 7916201c4da9a29abc0ac1ef3ee80c8e3efdcf72
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Fri Jun 25 11:33:27 2021 +0200

    reconfigure: Use 'formatted-message'.
    
    * guix/scripts/system/reconfigure.scm (ensure-forward-reconfigure): Use
    'formatted-message'.
    * guix/scripts/deploy.scm (deploy-machine*): Handle it.
---
 guix/scripts/deploy.scm             | 9 +++++++++
 guix/scripts/system/reconfigure.scm | 9 ++++-----
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/guix/scripts/deploy.scm b/guix/scripts/deploy.scm
index 8bb8a79..1707622 100644
--- a/guix/scripts/deploy.scm
+++ b/guix/scripts/deploy.scm
@@ -28,6 +28,8 @@
   #:use-module (guix utils)
   #:use-module (guix grafts)
   #:use-module (guix status)
+  #:use-module (guix diagnostics)
+  #:use-module (guix i18n)
   #:use-module (ice-9 format)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-26)
@@ -132,6 +134,13 @@ Perform the deployment specified by FILE.\n"))
             (leave (G_ "failed to deploy ~a: ~a~%")
                    (machine-display-name machine)
                    (condition-message c)))
+           ((formatted-message? c)
+            (leave (G_ "failed to deploy ~a: ~a~%")
+                   (machine-display-name machine)
+                   (apply format #f
+                          (gettext (formatted-message-string c)
+                                   %gettext-domain)
+                          (formatted-message-arguments c))))
            ((deploy-error? c)
             (when (deploy-error-should-roll-back c)
               (info (G_ "rolling back ~a...~%")
diff --git a/guix/scripts/system/reconfigure.scm 
b/guix/scripts/system/reconfigure.scm
index 39a818d..49da6ec 100644
--- a/guix/scripts/system/reconfigure.scm
+++ b/guix/scripts/system/reconfigure.scm
@@ -308,12 +308,11 @@ ancestor of COMMIT, unless CHANNEL specifies a commit."
     ('self #t)
     (_
      (raise (make-compound-condition
-             (condition
-              (&message (message
-                         (format #f (G_ "\
+             (formatted-message (G_ "\
 aborting reconfiguration because commit ~a of channel '~a' is not a descendant 
of ~a")
-                                 commit (channel-name channel)
-                                 start)))
+                                commit (channel-name channel)
+                                start)
+             (condition
               (&fix-hint
                (hint (G_ "Use @option{--allow-downgrades} to force
 this downgrade.")))))))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]