move function

This commit is contained in:
Tobias Powalowski 2022-11-29 11:00:06 +01:00
parent d1527d5014
commit 0bf7344a74
3 changed files with 12 additions and 4 deletions

View file

@ -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

View file

@ -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
}

View file

@ -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
}