Skip to content

Commit

Permalink
init: fix arch locale-gen (#1520)
Browse files Browse the repository at this point in the history
  • Loading branch information
Boria138 authored Oct 10, 2024
1 parent 1a7381e commit 54aad24
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions distrobox-init
Original file line number Diff line number Diff line change
Expand Up @@ -1176,14 +1176,6 @@ setup_pacman()
sed -i "s|NoExtract.*||g" /etc/pacman.conf
sed -i "s|NoProgressBar.*||g" /etc/pacman.conf

# In case the locale is not available, install it
# will ensure we don't fallback to C.UTF-8
if ! locale -a | grep -qi en_us.utf8 || ! locale -a | grep -qi "${HOST_LOCALE}"; then
sed -i "s|#.*en_US.UTF-8|en_US.UTF-8|g" /etc/locale.gen
sed -i "s|#.*${HOST_LOCALE}|${HOST_LOCALE}|g" /etc/locale.gen
locale-gen -a
fi

pacman -S -u --noconfirm
# Check if shell_pkg is available in distro's repo. If not we
# fall back to bash, and we set the SHELL variable to bash so
Expand Down Expand Up @@ -1238,6 +1230,10 @@ setup_pacman()
# shellcheck disable=SC2086,2046
pacman -S --needed --noconfirm $(pacman -Ssq | grep -E "^($(echo ${deps} | tr ' ' '|'))$")

if [ ! -e "/usr/share/i18n/locales${HOST_LOCALE}" ]; then
pacman -S --noconfirm glibc
fi

# Setup hooks
setup_pacman_exceptions

Expand All @@ -1248,6 +1244,14 @@ setup_pacman()
pacman -S --noconfirm tzdata
fi

# In case the locale is not available, install it
# will ensure we don't fallback to C.UTF-8
if ! locale -a | grep -qi en_us.utf8 || ! locale -a | grep -qi "${HOST_LOCALE}"; then
sed -i "s|#.*en_US.UTF-8|en_US.UTF-8|g" /etc/locale.gen
sed -i "s|#.*${HOST_LOCALE}|${HOST_LOCALE}|g" /etc/locale.gen
locale-gen -a
fi

# Install additional packages passed at distrbox-create time
if [ -n "${container_additional_packages}" ]; then
# shellcheck disable=SC2086
Expand Down

0 comments on commit 54aad24

Please sign in to comment.