teknoraver / rpms / systemd

Forked from rpms/systemd a month ago
Clone

Blame SOURCES/0233-test-install-C.UTF-8-and-English-locales.patch

594167
From 9e35f5e32eeacdeeb0d2b520320b08daafc11c72 Mon Sep 17 00:00:00 2001
594167
From: Yu Watanabe <watanabe.yu+github@gmail.com>
594167
Date: Tue, 14 Jun 2022 09:13:00 +0900
594167
Subject: [PATCH] test: install C.UTF-8 and English locales
594167
594167
(cherry picked from commit 4ce68ea9b3707fde8c4be20e164fc2a41197fdda)
594167
594167
Related: #2087652
594167
---
594167
 test/test-functions | 24 ++++++++++++++++++++++++
594167
 1 file changed, 24 insertions(+)
594167
594167
diff --git a/test/test-functions b/test/test-functions
594167
index 644c3a8613..cab3e3c015 100644
594167
--- a/test/test-functions
594167
+++ b/test/test-functions
594167
@@ -684,6 +684,7 @@ setup_basic_environment() {
594167
     install_pam
594167
     install_dbus
594167
     install_fonts
594167
+    install_locales
594167
     install_keymaps
594167
     install_x11_keymaps
594167
     install_terminfo
594167
@@ -1847,6 +1848,29 @@ install_pam() {
594167
     done
594167
 }
594167
 
594167
+install_locales() {
594167
+    # install only C.UTF-8 and English locales
594167
+    dinfo "Install locales"
594167
+
594167
+    if command -v meson >/dev/null \
594167
+            && (meson configure "${BUILD_DIR:?}" | grep 'localegen-path */') \
594167
+            || get_bool "$LOOKS_LIKE_DEBIAN"; then
594167
+        # locale-gen support
594167
+        image_install -o locale-gen localedef
594167
+        inst /etc/locale.gen || :
594167
+        inst /usr/share/i18n/SUPPORTED || :
594167
+        inst_recursive /usr/share/i18n/charmaps
594167
+        inst_recursive /usr/share/i18n/locales
594167
+        inst_recursive /usr/share/locale/en
594167
+        inst_recursive /usr/share/locale/en_*
594167
+    fi
594167
+
594167
+    inst_recursive /usr/lib/locale/C.utf8
594167
+    inst_recursive /usr/lib/locale/C.UTF-8
594167
+    inst_recursive /usr/lib/locale/en_*.utf8
594167
+    inst_recursive /usr/lib/locale/en_*.UTF-8
594167
+}
594167
+
594167
 # shellcheck disable=SC2120
594167
 install_keymaps() {
594167
     local i p