vm: Build ISOs and VM images in a UTF-8 environment.
authorLudovic Courtès <ludo@gnu.org>
Wed, 1 May 2019 19:11:22 +0000 (21:11 +0200)
committerLudovic Courtès <ludo@gnu.org>
Wed, 1 May 2019 19:11:22 +0000 (21:11 +0200)
Fixes a bug whereby building an image containing non-ASCII file names
would fail due to improper decoding of file names.

* gnu/system/vm.scm (iso9660-image, qemu-image): Set GUIX_LOCPATH and
call 'setlocale' in the build environment.

gnu/system/vm.scm

index 92b03b0..124abd0 100644 (file)
@@ -283,6 +283,11 @@ INPUTS is a list of inputs (as for packages)."
 
            (sql-schema #$schema)
 
+           ;; Allow non-ASCII file names--e.g., 'nss-certs'--to be decoded.
+           (setenv "GUIX_LOCPATH"
+                   #+(file-append glibc-utf8-locales "/lib/locale"))
+           (setlocale LC_ALL "en_US.utf8")
+
            (let ((inputs
                   '#$(append (list qemu parted e2fsprogs dosfstools xorriso)
                              (map canonical-package
@@ -379,6 +384,11 @@ the image."
 
            (sql-schema #$schema)
 
+           ;; Allow non-ASCII file names--e.g., 'nss-certs'--to be decoded.
+           (setenv "GUIX_LOCPATH"
+                   #+(file-append glibc-utf8-locales "/lib/locale"))
+           (setlocale LC_ALL "en_US.utf8")
+
            (let ((inputs
                   '#$(append (list qemu parted e2fsprogs dosfstools)
                              (map canonical-package