* [devel-distro] [solved] installer, lang= и странная локализация
@ 2020-09-17 20:15 Michael Shigorin
0 siblings, 0 replies; only message in thread
From: Michael Shigorin @ 2020-09-17 20:15 UTC (permalink / raw)
To: devel-distro
[-- Attachment #1: Type: text/plain, Size: 1756 bytes --]
Здравствуйте.
Пока частично разобрался, хотя бы задокументирую.
Если в стадию install2 не попадают glibc-locales и поэтому
locale -a в ней не выдаёт в т.ч. ru_RU -- то при lang=ru_RU
вот этот кусочек installer просто пойдёт дальше:
---
45 set_locale()
46 {
47 LANG=
48 export LANG
49
50 local lang=
51 for d in $cmdline; do
52 [ -z "${d%%lang=*}" ] || continue
53 lang="${d#lang=}"
54 break
55 done
56 [ -n "$lang" ] || lang=en_US
57 locale -a 2>/dev/null |cut -d. -f1 |fgrep -xqs "$lang" || return 0
58
59 LANG="$lang.$charset"
60 echo LC_ALL="$lang.$charset" > /etc/sysconfig/i18n
61 }
--- installer/scripts/install2
Результатом будет то, что часть информации на экране представлена
по-русски (имя шага, "галочки" выбора групп пакетов), а часть --
по-английски (кнопка Next, обрамление формы выбора групп пакетов).
Почему-то при сборке пакета installer версии 1.10.4-alt1 в p9_e2k
(как и при пересборке 1.8.48-alt1) installer-common-stage2 не
получает зависимость от glibc-locales, несмотря на вызов
находящейся в нём команды locale; в пакете 1.8.48-alt1, собравшемся
11.04.2019, такая зависимость сгенерирована (как и в p9/x86_64).
В качестве костыля добавил в зависимости installer-common-stage2
1.10.4-alt2; повесил себе #38955.
PS: сделал набросок коммита в m-p для настройки %_install_langs
со списком языков install2, которые есть в alterator-l10n:
de es kk pt_BR ru tt_RU uk (далее просится в фичу l10n);
но туда кто-то пишет all, понять бы, кто -- потому как
в scripts.d, похоже, уже поздно.
--
---- WBR, Michael Shigorin / http://altlinux.org
------ http://opennet.ru / http://anna-news.info
[-- Attachment #2: 0001-install2-handle-_install_langs.patch --]
[-- Type: text/x-patch, Size: 1217 bytes --]
>From 8e44d83773efd20c38298c28165b42ad27f200db Mon Sep 17 00:00:00 2001
From: Michael Shigorin <mike@altlinux.org>
Date: Thu, 17 Sep 2020 22:09:30 +0300
Subject: [PATCH] install2: handle %_install_langs
There's no sense to have locales that the user is unable
to even choose from: one can pass lang=ab_CD by hand but
alterator-{l10n,sysinfo} just won't learn it instantly.
NB: override "%_install_langs all" that might be there,
both lines available result in all locales installed.
---
.../install2/install2/scripts.d/50-install2-langs | 9 +++++++++
1 file changed, 9 insertions(+)
create mode 100755 features.in/install2/install2/scripts.d/50-install2-langs
diff --git a/features.in/install2/install2/scripts.d/50-install2-langs b/features.in/install2/install2/scripts.d/50-install2-langs
new file mode 100755
index 000000000..72788dafc
--- /dev/null
+++ b/features.in/install2/install2/scripts.d/50-install2-langs
@@ -0,0 +1,9 @@
+#!/bin/sh
+# restrict available locales to languages
+# with available alterator translations
+# (listed as of alterator-l10n 2.9.74)
+
+mkdir -p "$WORKDIR"/etc/rpm
+cat > "$WORKDIR"/etc/rpm/macros << EOF
+%_install_langs de es kk pt_BR ru tt_RU uk
+EOF
--
2.25.4
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-09-17 20:15 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-17 20:15 [devel-distro] [solved] installer, lang= и странная локализация Michael Shigorin
ALT Linux Distributions development
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/devel-distro/0 devel-distro/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 devel-distro devel-distro/ http://lore.altlinux.org/devel-distro \
devel-distro@lists.altlinux.org devel-distro@lists.altlinux.ru devel-distro@lists.altlinux.com
public-inbox-index devel-distro
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.devel-distro
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git