From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53404) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dX8Ek-00011z-0a for guix-patches@gnu.org; Mon, 17 Jul 2017 11:47:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dX8Eg-0002hV-TO for guix-patches@gnu.org; Mon, 17 Jul 2017 11:47:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:42010) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dX8Eg-0002hM-PL for guix-patches@gnu.org; Mon, 17 Jul 2017 11:47:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dX8Eg-00030C-ID for guix-patches@gnu.org; Mon, 17 Jul 2017 11:47:02 -0400 Subject: [bug#27675] [PATCH] gnu: kbd: Recursively search $LOADKEYS_KEYMAP_PATH. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) In-Reply-To: <1a1b4745-31a4-f32c-ed46-cb7640591aae@tobias.gr> (Tobias Geerinckx-Rice's message of "Mon, 17 Jul 2017 13:43:47 +0200") References: <20170713003425.31282-1-me@tobias.gr> <87poczctc8.fsf@gnu.org> <383b1065-2c96-4982-2fc1-92b356a50838@tobias.gr> <87d18z9vks.fsf@gnu.org> <1a1b4745-31a4-f32c-ed46-cb7640591aae@tobias.gr> Date: Mon, 17 Jul 2017 17:46:21 +0200 Message-ID: <87d18z5anm.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Tobias Geerinckx-Rice Cc: 27675@debbugs.gnu.org Hello, Tobias Geerinckx-Rice skribis: > On 17/07/17 13:00, Ludovic Court=C3=A8s wrote: >> I mean, it works because it turns out that we pass those ** to Bash,=20 >> which does the right thing. > > But that's not true: > > /* Search a list of directories and directory hierarchies */ > for (i =3D 0; dirpath[i]; i++) { > recdepth =3D 0; > dl =3D strlen(dirpath[i]); > > /* trailing stars denote recursion */ > while (dl && dirpath[i][dl - 1] =3D=3D '*') > dl--, recdepth++; > > (src/libkeymap/findfile.c:269). Ah OK, if that=E2=80=99s a libkeymap thing, that=E2=80=99s better (I should= know Bash better!). >> However, a search-path specification is supposed to be >> understandable internally by =E2=80=98evaluate-search-paths=E2=80=99 > > Erk. So you're saying Guix tries to do clever things (beyond separator > concatenation) to search-paths before exporting them? That won't work. > If that is the case, we'll have to use something other than search-paths > for kbd (and any packages that interpret things like =E2=80=98*=E2=80=99 = themselves, > without a shell). > > But again, at least in the installer image, LOADKEYS_KEYMAP_PATH is > properly untouched as far as I've tested. Yes, that=E2=80=99s OK. What I meant is that search-path-specifications have clear semantics that are interpreted by =E2=80=98evaluate-search-paths=E2=80=99. In this c= ase, what happens is this: --8<---------------cut here---------------start------------->8--- scheme@(guile-user)> ,use(guix search-paths) scheme@(guile-user)> (search-path-specification (variable "LOADKEYS_KEYMAP_PATH") ;; Append =E2=80=98/**=E2=80=99 to recursively search all direc= tories. One can then ;; run (for example) =E2=80=98loadkeys en-latin9=E2=80=99 inste= ad of having to find ;; and type =E2=80=98i386/colemak/en-latin9=E2=80=99 on a misla= belled keyboard. (files (list "share/keymaps/**"))) $4 =3D #< variable: "LOADKEYS_KEYMAP_PATH" files= : ("share/keymaps/**") separator: ":" file-type: directory file-pattern: #f> scheme@(guile-user)> (evaluate-search-paths (list $4) (list "/run/current-s= ystem/profile")) --8<---------------cut here---------------end--------------->8--- AFAICS, /run/current-system/profile/etc/profile does not include a LOADKEYS_KEYMAP_PATH definition because of that. Or am I missing something? Thank you, Ludo=E2=80=99.