V8.00.000.2025.06.17
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 52s
All checks were successful
🛡️ Shell Script Linting / 🛡️ Shell Script Linting (push) Successful in 52s
Signed-off-by: Marc S. Weidner <msw@coresecret.dev>
This commit is contained in:
@@ -64,23 +64,30 @@ setup_locales() {
|
||||
# SPDX-Security-Contact: security@coresecret.eu
|
||||
|
||||
set -x
|
||||
exec 2>/tmp/locale-hook-debug.log
|
||||
set -Ceuo pipefail
|
||||
|
||||
### Register selections
|
||||
if [[ ! -d /usr/share/i18n/locales ]]; then
|
||||
echo "ERROR: Directory /usr/share/i18n/locales missing. Is package 'locales' installed?" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "locales locales/locales_to_be_generated multiselect ${locale_locale:-en_US.UTF-8} UTF-8" | debconf-set-selections
|
||||
echo "locales locales/default_environment_locale select ${locale_locale:-en_US.UTF-8}" | debconf-set-selections
|
||||
|
||||
### Reconfigure and regenerate
|
||||
dpkg-reconfigure -f noninteractive locales
|
||||
locale-gen
|
||||
|
||||
if ! locale -a | grep -qx "${locale_locale:-en_US.UTF-8}" > /dev/null 2>&1 || true; then
|
||||
echo "ERROR: Locale '${locale_locale:-en_US.UTF-8}' has not been generated successfully." >&2
|
||||
sleep 30
|
||||
if ! grep -qx "${locale_locale:-en_US.UTF-8} UTF-8" /etc/locale.gen; then
|
||||
sed -i "s/# ${locale_locale:-en_US.UTF-8} UTF-8/${locale_locale:-en_US.UTF-8} UTF-8/" /etc/locale.gen || \
|
||||
echo "${locale_locale:-en_US.UTF-8} UTF-8" >> /etc/locale.gen
|
||||
fi
|
||||
|
||||
locale-gen --purge "${locale_locale:-en_US.UTF-8}"
|
||||
|
||||
if ! (locale -a | grep -qx "${locale_locale:-en_US.UTF-8}"); then
|
||||
echo "ERROR: Locale '${locale_locale:-en_US.UTF-8}' was not generated successfully." >&2
|
||||
locale -a >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
locale -a
|
||||
cat /etc/locale.gen
|
||||
|
||||
if update-locale \
|
||||
LANG=${locale_locale} \
|
||||
|
||||
Reference in New Issue
Block a user