This is an automated email from the ASF dual-hosted git repository.
weizhou pushed a commit to branch 4.20
in repository https://gitbox.apache.org/repos/asf/cloudstack.git
The following commit(s) were added to refs/heads/4.20 by this push:
new b82369c2415 systemvm: fix duplicated "en_US.UTF-8 UTF-8" in
/etc/locale.gen (#11823)
b82369c2415 is described below
commit b82369c2415dc8fb05c95ba0f1975788b9c143ef
Author: Wei Zhou <[email protected]>
AuthorDate: Wed Oct 15 11:42:24 2025 +0200
systemvm: fix duplicated "en_US.UTF-8 UTF-8" in /etc/locale.gen (#11823)
---
tools/appliance/systemvmtemplate/scripts/configure_locale.sh | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/appliance/systemvmtemplate/scripts/configure_locale.sh
b/tools/appliance/systemvmtemplate/scripts/configure_locale.sh
index 8db7e4e5598..f5477506cfd 100644
--- a/tools/appliance/systemvmtemplate/scripts/configure_locale.sh
+++ b/tools/appliance/systemvmtemplate/scripts/configure_locale.sh
@@ -22,13 +22,15 @@ set -x
function configure_locale() {
grep LANG=en_US.UTF-8 /etc/default/locale && \
grep LC_ALL=en_US.UTF-8 /etc/default/locale && \
- grep "en_US.UTF-8 UTF-8" /etc/locale.gen &&
+ grep "^en_US.UTF-8 UTF-8" /etc/locale.gen &&
return
cat >> /etc/default/locale << EOF
LANG=en_US.UTF-8
LC_ALL=en_US.UTF-8
EOF
+
+ grep "^en_US.UTF-8 UTF-8" /etc/locale.gen || \
cat >> /etc/locale.gen << EOF
en_US.UTF-8 UTF-8
EOF