guix-commits
[Top][All Lists]
Advanced

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

05/06: installer: Do not set the locale in run-command.


From: guix-commits
Subject: 05/06: installer: Do not set the locale in run-command.
Date: Thu, 30 Dec 2021 05:38:23 -0500 (EST)

mothacehe pushed a commit to branch wip-harden-installer
in repository guix.

commit 12dea9e0942b51715acd08893d06b86ad0e0cedd
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Thu Dec 30 11:31:45 2021 +0100

    installer: Do not set the locale in run-command.
    
    Installing the locale inside the container, once the cow-store is mounted,
    causes the process to keep opened locale files that can later prevent the
    cow-store umount.
    
    * gnu/installer/utils.scm (run-command): Remove locale argument.
    * gnu/installer/final.scm (install-system): Adapt it.
---
 gnu/installer/final.scm |  5 ++---
 gnu/installer/utils.scm | 18 +++---------------
 2 files changed, 5 insertions(+), 18 deletions(-)

diff --git a/gnu/installer/final.scm b/gnu/installer/final.scm
index c6987e6e58..bef5f9fd52 100644
--- a/gnu/installer/final.scm
+++ b/gnu/installer/final.scm
@@ -191,9 +191,8 @@ or #f.  Return #t on success and #f on failure."
                          (lambda ()
                            (with-error-to-file "/dev/console"
                              (lambda ()
-                               (run-command install-command
-                                            #:locale locale)))))
-                       (run-command install-command #:locale locale))))
+                               (run-command install-command)))))
+                       (run-command install-command))))
            (lambda ()
              ;; Restart guix-daemon so that it does no keep the MNT namespace
              ;; alive.
diff --git a/gnu/installer/utils.scm b/gnu/installer/utils.scm
index bb97bc5560..9bd41e2ca0 100644
--- a/gnu/installer/utils.scm
+++ b/gnu/installer/utils.scm
@@ -74,9 +74,9 @@ number. If no percentage is found, return #f"
     (and result
          (string->number (match:substring result 1)))))
 
-(define* (run-command command #:key locale)
-  "Run COMMAND, a list of strings, in the given LOCALE.  Return true if
-COMMAND exited successfully, #f otherwise."
+(define* (run-command command)
+  "Run COMMAND, a list of strings.  Return true if COMMAND exited
+successfully, #f otherwise."
   (define env (environ))
 
   (define (pause)
@@ -90,18 +90,6 @@ COMMAND exited successfully, #f otherwise."
 
   (setenv "PATH" "/run/current-system/profile/bin")
 
-  (when locale
-    (let ((supported? (false-if-exception
-                       (setlocale LC_ALL locale))))
-      ;; If LOCALE is not supported, then set LANGUAGE, which might at
-      ;; least give us translated messages.
-      (if supported?
-          (setenv "LC_ALL" locale)
-          (setenv "LANGUAGE"
-                  (string-take locale
-                               (or (string-index locale #\_)
-                                   (string-length locale)))))))
-
   (guard (c ((invoke-error? c)
              (newline)
              (format (current-error-port)



reply via email to

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