Browse Source

substitute: Install the client's locale.

* guix/store.scm (set-build-options): Add #:locale parameter and honor
it.
* guix/scripts/substitute.scm (guix-substitute): Install the client's
locale.
version-0.11.0
Ludovic Courtès 6 years ago
parent
commit
38f50f49f3
  1. 7
      guix/scripts/substitute.scm
  2. 8
      guix/store.scm

7
guix/scripts/substitute.scm

@ -1000,6 +1000,13 @@ default value."
(newline)
(force-output (current-output-port))
;; Attempt to install the client's locale, mostly so that messages are
;; suitably translated.
(match (or (find-daemon-option "untrusted-locale")
(find-daemon-option "locale"))
(#f #f)
(locale (false-if-exception (setlocale LC_ALL locale))))
(with-networking
(with-error-handling ; for signature errors
(match args

8
guix/store.scm

@ -534,7 +534,10 @@ encoding conversion errors."
(substitute-urls #f)
;; Number of columns in the client's terminal.
(terminal-columns (terminal-columns)))
(terminal-columns (terminal-columns))
;; Locale of the client.
(locale (false-if-exception (setlocale LC_ALL))))
;; Must be called after `open-connection'.
(define socket
@ -573,6 +576,9 @@ encoding conversion errors."
,@(if terminal-columns
`(("terminal-columns"
. ,(number->string terminal-columns)))
'())
,@(if locale
`(("locale" . ,locale))
'()))))
(send (string-pairs pairs))))
(let loop ((done? (process-stderr server)))

Loading…
Cancel
Save