richardphibel / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
ac3a84
From ea8b80cdc0dfd0ad92301a0e421df4d3110fe09c Mon Sep 17 00:00:00 2001
ac3a84
From: Frantisek Sumsal <frantisek@sumsal.cz>
ac3a84
Date: Mon, 7 Nov 2022 11:57:59 +0100
ac3a84
Subject: [PATCH] test: fix locale installation when locale-gen is used
ac3a84
ac3a84
locale-gen might merge all compiled locales into a simple archive, so we
ac3a84
need to install it as well if necessary.
ac3a84
ac3a84
(cherry picked from commit 0c416ea01bc14adff10f4fc5415a36bd2d48f604)
ac3a84
ac3a84
Related #2138081
ac3a84
---
ac3a84
 test/test-functions | 19 ++++++++++++-------
ac3a84
 1 file changed, 12 insertions(+), 7 deletions(-)
ac3a84
ac3a84
diff --git a/test/test-functions b/test/test-functions
ac3a84
index 80ce383e64..45ca472916 100644
ac3a84
--- a/test/test-functions
ac3a84
+++ b/test/test-functions
ac3a84
@@ -1988,14 +1988,19 @@ install_locales() {
ac3a84
         inst /usr/share/i18n/SUPPORTED || :
ac3a84
         inst_recursive /usr/share/i18n/charmaps
ac3a84
         inst_recursive /usr/share/i18n/locales
ac3a84
-        inst_recursive /usr/share/locale/en
ac3a84
-        inst_recursive /usr/share/locale/en_*
ac3a84
+        inst_recursive /usr/share/locale/en*
ac3a84
+        inst_recursive /usr/share/locale/de*
ac3a84
+        image_install /usr/share/locale/locale.alias
ac3a84
+        # locale-gen might either generate each locale separately or merge them
ac3a84
+        # into a single archive
ac3a84
+        if ! (inst_recursive /usr/lib/locale/C.*8 /usr/lib/locale/en_*8 ||
ac3a84
+              image_install /usr/lib/locale/locale-archive); then
ac3a84
+            dfatal "Failed to install required locales"
ac3a84
+            exit 1
ac3a84
+        fi
ac3a84
+    else
ac3a84
+        inst_recursive /usr/lib/locale/C.*8 /usr/lib/locale/en_*8
ac3a84
     fi
ac3a84
-
ac3a84
-    inst_recursive /usr/lib/locale/C.utf8
ac3a84
-    inst_recursive /usr/lib/locale/C.UTF-8
ac3a84
-    inst_recursive /usr/lib/locale/en_*.utf8
ac3a84
-    inst_recursive /usr/lib/locale/en_*.UTF-8
ac3a84
 }
ac3a84
 
ac3a84
 # shellcheck disable=SC2120