[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#44196: [PATCH v6 3/4] system: Do not depend on locale folder generat
From: |
Miguel Ángel Arruga Vivas |
Subject: |
bug#44196: [PATCH v6 3/4] system: Do not depend on locale folder generated by |
Date: |
Sun, 01 Nov 2020 01:36:38 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) |
¡Hola, Ludo!
Thanks for your comments. Reviewing them I found some more issues that
I address inline:
Ludovic Courtès <ludo@gnu.org> writes:
> Miguel Ángel Arruga Vivas <rosen644835@gmail.com> skribis:
>
>> From 5886bdf74bda59649b3d17b691132d9d030e0fb4 Mon Sep 17 00:00:00 2001
>> From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?=
>> <rosen644835@gmail.com>
>> Date: Sat, 24 Oct 2020 20:36:21 +0200
>> Subject: [PATCH] system: Do not depend on locale folder generated by
>> grub-install.
I've changed the title to "system: Generate grub locale directory for
grub.cfg.", which is positive, shorter and more descriptive. I have to
work on my communicative skills a lot...
>>
>> * gnu/bootloader/grub.scm (define-module): Use (guix packages).
This was a leftover from the modification of Grub itself instead of
using computed-file and not needed anymore, removed.
>> (grub-locale-folder): New computed folder.
>> (grub-configuration-file)[locale-config]: Use grub-locale-folder only when a
>> locale is needed.
Changed with the new names and added an explanation about the search.
>
> [...]
>
>> +(define (grub-locale-folder grub)
>> + "Generate a folder with the locales from GRUB."
>
> s/folder/directory/ :-)
Applied, both in the function name and the documentation string.
>> + (define builder
>> + #~(begin
>> + (use-modules (ice-9 ftw))
>> + (let ((locale (string-append #$grub "/share/locale"))
>> + (out #$output))
>> + (mkdir out)
>> + (chdir out)
>> + (for-each (lambda (lang)
>> + (let ((file (string-append locale "/" lang
>> + "/LC_MESSAGES/grub.mo"))
>> + (dest (string-append lang ".mo")))
>> + (when (file-exists? file)
>> + (copy-file file dest))))
>> + (scandir locale)))))
>> + (computed-file "grub-boot-locale" builder))
>
> Maybe just “grub-locales”?
This name sounds right, applied too. :-)
>> + (let* ((entry (first all-entries))
>> + (device (menu-entry-device entry))
>> + (mount-point (menu-entry-device-mount-point entry))
>> + (bootloader (bootloader-configuration-bootloader config))
>> + (grub (bootloader-package bootloader))
>> + (locale-dir (normalize-file (grub-locale-folder grub)
>> + mount-point
>> + store-directory-prefix)))
>
> Nitpick: maybe s/locale-dir/locales/
Applied too, but I moved this call from the let* to ...
>> + #~(let ((locale #$(and locale
>> + (locale-definition-source
>> + (locale-name->definition locale))))
>> + (locale-dir #$(and locale locale-dir)))
... here, to avoid the generation when there is no locale, which
shouldn't be a common use case, but it shouldn't depend on the
generation of that directory because it won't be used.
>> + (when locale
>> + (format port "\
>> # Localization configuration.
>> -if search --file --set boot_partition /grub/grub.cfg; then
>> - set locale_dir=(${boot_partition})/grub/locale
>> -else
>> - set locale_dir=/boot/grub/locale
>> -fi
>> -set lang=~a~%" locale))))
>> +~asearch --file --set ~a/en@quot.mo
>> +set locale_dir=~a
>> +set lang=~a~%"
>
> Otherwise LGTM, thanks!
Thank you again for the review. Pushed as
f445bc65764ffad2ae9f3b382ddb8feb4eeea2fb with these fixes, after running
again make check and a subset of make check-system.
Happy hacking!
Miguel
- bug#44196: [PATCH 2/3] system: Add store-directory-prefix to boot-parameters., (continued)
bug#44196: [PATCH 3/3] gnu: grub: Add output locale, Miguel Ángel Arruga Vivas, 2020/10/24
- bug#44196: [PATCH 3/3 v2] gnu: grub: Add locale output., Miguel Ángel Arruga Vivas, 2020/10/25
- bug#44196: [PATCH 3/3 v3] system: Do not depend on locale folder generated by grub-install., Miguel Ángel Arruga Vivas, 2020/10/26
- bug#44196: [PATCH v4 3/4] system: Do not depend on locale folder generated by, Miguel Ángel Arruga Vivas, 2020/10/28
- bug#44196: [PATCH v5 3/4] system: Do not depend on locale folder generated by, Miguel Ángel Arruga Vivas, 2020/10/30
- bug#44196: [PATCH v6 3/4] system: Do not depend on locale folder generated by, Miguel Ángel Arruga Vivas, 2020/10/30
- bug#44196: [PATCH v6 3/4] system: Do not depend on locale folder generated by, Ludovic Courtès, 2020/10/31
- bug#44196: [PATCH v6 3/4] system: Do not depend on locale folder generated by,
Miguel Ángel Arruga Vivas <=
bug#44196: [PATCH 4/3] system: Fix dependency for grub.cfg generation., Miguel Ángel Arruga Vivas, 2020/10/26