about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--installer.sh.in15
1 files changed, 8 insertions, 7 deletions
diff --git a/installer.sh.in b/installer.sh.in
index ed2782b..90a69bc 100644
--- a/installer.sh.in
+++ b/installer.sh.in
@@ -323,13 +323,14 @@ menu_locale() {
 }
 
 set_locale() {
-    local LOCALE=$(get_option LOCALE)
-
-    sed -i -e "s|LANG=.*|LANG=$LOCALE|g" $TARGETDIR/etc/locale.conf
-    # Uncomment locale from /etc/default/libc-locales and regenerate it.
-    sed -e "/${LOCALE}/s/^\#//" -i $TARGETDIR/etc/default/libc-locales
-    echo "Running xbps-reconfigure -f glibc-locales ..." >$LOG
-    chroot $TARGETDIR xbps-reconfigure -f glibc-locales >$LOG 2>&1
+    if [ -f $TARGETDIR/etc/default/libc-locales ]; then
+        local LOCALE=$(get_option LOCALE)
+        sed -i -e "s|LANG=.*|LANG=$LOCALE|g" $TARGETDIR/etc/locale.conf
+        # Uncomment locale from /etc/default/libc-locales and regenerate it.
+        sed -e "/${LOCALE}/s/^\#//" -i $TARGETDIR/etc/default/libc-locales
+        echo "Running xbps-reconfigure -f glibc-locales ..." >$LOG
+        chroot $TARGETDIR xbps-reconfigure -f glibc-locales >$LOG 2>&1
+    fi
 }
 
 menu_timezone() {