From 3ea95d7736be1f807d578d17c174b0976543b333 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Lopez?= Date: Thu, 19 Dec 2024 01:15:05 +0100 Subject: [PATCH] =?UTF-8?q?pack:=20Fix=20type=20error=20in=20=E2=80=98asse?= =?UTF-8?q?rt-utf8-locale=E2=80=99.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit getenv returns #f if the environment variable does not exist, causing a type error since string=? expects a string. * guix/build/pack.scm (assert-utf8-locale): Handle unset environment variable. Change-Id: Idbe7a33a4c8453b8f4ffe6245c32c1373020fb06 Signed-off-by: Ludovic Courtès --- guix/build/pack.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/guix/build/pack.scm b/guix/build/pack.scm index fcb1da2a6c44457487a81558aa07c48e82984d95..1b28101469831f30bc1e8c3bf918200321bc6594 100644 --- a/guix/build/pack.scm +++ b/guix/build/pack.scm @@ -72,7 +72,7 @@ the `-I' option." (define (assert-utf8-locale) "Verify the current process is using the en_US.utf8 locale." - (unless (string=? "unset for tests" (getenv "GUIX_LOCPATH")) + (unless (string=? "unset for tests" (or (getenv "GUIX_LOCPATH") "")) (unless (false-if-exception (setlocale LC_ALL "en_US.utf8")) (error "environment not configured for en_US.utf8 locale"))))