From 0bf7344a74b796209609394dbc642e1820d283e6 Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Tue, 29 Nov 2022 11:00:06 +0100 Subject: [PATCH] move function --- usr/bin/archboot-setup.sh | 2 +- usr/lib/archboot/installer/autoconfiguration.sh | 10 ++++++++++ usr/lib/archboot/installer/configuration.sh | 4 +--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/usr/bin/archboot-setup.sh b/usr/bin/archboot-setup.sh index 440f3045c..72a1d9345 100755 --- a/usr/bin/archboot-setup.sh +++ b/usr/bin/archboot-setup.sh @@ -135,7 +135,7 @@ configure_system() { elif [[ "${FILE}" = "/etc/mkinitcpio.conf" ]]; then # non-file set_mkinitcpio elif [[ "${FILE}" = "/etc/locale.gen" ]]; then # non-file - set_locale + _auto_set_locale ${EDITOR} "${DESTDIR}""${FILE}" run_locale_gen elif [[ "${FILE}" = "Root-Password" ]]; then # non-file diff --git a/usr/lib/archboot/installer/autoconfiguration.sh b/usr/lib/archboot/installer/autoconfiguration.sh index d326f0b1f..d74de6dbf 100644 --- a/usr/lib/archboot/installer/autoconfiguration.sh +++ b/usr/lib/archboot/installer/autoconfiguration.sh @@ -224,3 +224,13 @@ auto_locale() { sleep 1 fi } + +_auto_set_locale() { + # enable glibc locales from locale.conf + #shellcheck disable=SC2013 + DIALOG --infobox "Enable glibc locales based on locale.conf on installed system ..." 3 70 + for i in $(grep "^LANG" "${DESTDIR}"/etc/locale.conf | sed -e 's/.*=//g' -e's/\..*//g'); do + sed -i -e "s/^#${i}/${i}/g" "${DESTDIR}"/etc/locale.gen + done + sleep 2 +} diff --git a/usr/lib/archboot/installer/configuration.sh b/usr/lib/archboot/installer/configuration.sh index 15a4bfedb..c8ec7c181 100644 --- a/usr/lib/archboot/installer/configuration.sh +++ b/usr/lib/archboot/installer/configuration.sh @@ -55,13 +55,11 @@ set_locale() { set_locale=$(cat ${ANSWER}) fi sed -i -e "s#LANG=.*#LANG=${set_locale}#g" "${DESTDIR}"/etc/locale.conf - DIALOG --infobox "Setting LANG=${set_locale} on installed system ..." 3 70 + DIALOG --infobox "Setting locale LANG=${set_locale} on installed system ..." 3 70 SET_LOCALE="1" sleep 2 _auto_set_locale run_locale_gen - else - _auto_set_locale fi }