guix-commits
[Top][All Lists]
Advanced

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

02/02: installer: final: Dump "guix system init" command output when tes


From: guix-commits
Subject: 02/02: installer: final: Dump "guix system init" command output when testing.
Date: Tue, 9 Jun 2020 11:59:15 -0400 (EDT)

mothacehe pushed a commit to branch master
in repository guix.

commit 9392652e911b3963ef0f52f39677a6fc953f1e1e
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Tue Jun 9 17:29:23 2020 +0200

    installer: final: Dump "guix system init" command output when testing.
    
    When debugging the installation tests, it can be very handy to be able to 
read
    "guix system init" command output.
    
    * gnu/installer/final.scm (install-system): Dump installation command output
    to the console when running the installation tests.
---
 gnu/installer/final.scm | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/gnu/installer/final.scm b/gnu/installer/final.scm
index 90c76e9..e06b104 100644
--- a/gnu/installer/final.scm
+++ b/gnu/installer/final.scm
@@ -205,7 +205,18 @@ or #f.  Return #t on success and #f on failure."
       (lambda ()
         (start-service 'cow-store (list (%installer-target-dir))))
       (lambda ()
-        (run-command install-command #:locale locale))
+        ;; If there are any connected clients, assume that we are running
+        ;; installation tests. In that case, dump the standard and error
+        ;; outputs to syslog.
+        (if (not (null? (current-clients)))
+            (with-output-to-file "/dev/console"
+              (lambda ()
+                (with-error-to-file "/dev/console"
+                  (lambda ()
+                    (setvbuf (current-output-port) 'none)
+                    (setvbuf (current-error-port) 'none)
+                    (run-command install-command #:locale locale)))))
+            (run-command install-command #:locale locale)))
       (lambda ()
         (stop-service 'cow-store)
         ;; Remove the store overlay created at cow-store service start.



reply via email to

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