"Guy Ze Grant" <gzg@riseup.net> skribis:
Toggle quote (5 lines)
> I was asked to post here, so here it is; Attached is my expression thus
> far for kbd, at the patch phase though -- the following issue pops up:
> "find-files: ./doc/utf/??????: No such file or directory", along with a
> spew of guile barf following (which you can see in the kbd.scm.log file).
As we discussed on IRC, the problem is that POSIX considers file names
to be just byte strings, and the encoding is up to the application, and
locale-dependent by default. In practice people typically use UTF-8
(GLib and friends expect that.)
Here’s the problem and fix:
Toggle snippet (15 lines)
$ echo $LANG
en_US.UTF-8
$ ls -a
. .. ??
$ guile -c '(use-modules (ice-9 ftw)) (pk (scandir "."))'
;;; (("." ".." "??????"))
$ guile -c '(use-modules (ice-9 ftw)) (setlocale LC_ALL "en_US.utf8") (pk (scandir "."))'
;;; (("." ".." "??"))
In the first run Guile uses the “C” locale, so it’s unable to decode “??”.
In the second run it uses a UTF-8 locale, so everything works fine.
Back to kbd: can you add a phase after the ‘unpack’ phase that just
does this?
(setlocale "LC_ALL" "en_US.utf8")
If that works we can probably make it the default in the ‘core-updates’
branch.
Toggle quote (2 lines)
> (define-module (gnu packages kbd)
Since kbd is Linux-specific, could you put it in (gnu packages linux)?
[...]
Toggle quote (6 lines)
> 102: 1 [patch-source-shebangs # ...]
> In unknown file:
> ?: 0 [sort # #<procedure string<? (#:optional _ _ . _)>]
>
> ERROR: In procedure sort:
> ERROR: In procedure list-copy: Wrong type argument in position 1: ("./config/ylwrap" "./config/install-sh" "./config/depcomp" "./config/config.sub" "./config/config.rpath" "./config/missing" "./config/config.guess" "./config/mkinstalldirs" "./config/compile" "./
Toggle quote (2 lines)
> " "./doc/utf/README" "./doc/utf/ethiopic" . #f)
It’s also a bug that ‘find-files’ returns a improper list when
encountering such an issue. I’ll fit it in ‘core-updates’.
Thanks,
Ludo’.