[SCM] live-config branch, debian-next, updated. debian/3.0_a43-1-5-ga09a85f

Daniel Baumann daniel at debian.org
Thu Jul 19 00:06:31 UTC 2012


The following commit has been merged in the debian-next branch:
commit a09a85f44e093277686d815a5d5964e8e9d5caab
Author: Daniel Baumann <daniel at debian.org>
Date:   Thu Jul 19 02:07:07 2012 +0200

    Updating locales script to handle multiple locales, part 1.

diff --git a/scripts/config/0050-locales b/scripts/config/0050-locales
index 116a764..783f68d 100755
--- a/scripts/config/0050-locales
+++ b/scripts/config/0050-locales
@@ -34,37 +34,33 @@ Locales ()
 
 Configure_locales ()
 {
+	# Live system defaults
 	if [ -e /etc/default/locale ]
 	then
-		# use rootfs configured locale
-		_LOCALE="$(grep -s 'LANG=' /etc/default/locale | sed s/'LANG='// | tr -d '"' )"
+		# use rootfs configured locale as fallback
+		_LOCALE="$(grep -s 'LANG=' /etc/default/locale | sed -e 's|LANG=||' -e 's|"||g')"
 	fi
 
-	if [ -n "${LIVE_LOCALES}" ]
+	# Boot parameter defaults
+	if echo "${LIVE_LOCALES}" | grep -qs ","
 	then
-		_LOCALE="${LIVE_LOCALES}"
+		# multiple locales specified
+		_LOCALE="$(echo ${LIVE_LOCALES} | sed -e 's|,.*||')"
+		LIVE_LOCALES="$(echo ${LIVE_LOCALES} | sed -e 's|.*,||')"
 		_SET_LOCALE="true"
-	fi
-
-	if [ -z "${_LOCALE}" ]
-	then
-		# Set a default one
-		_LOCALE="en_US.UTF-8"
+	else
+		# single locales specified
+		_LOCALE="${LIVE_LOCALES:-en_US.UTF-8}"
+		LIVE_LOCALES=""
 		_SET_LOCALE="true"
 	fi
 
 	_LANGUAGE="$(echo ${_LOCALE} | cut -d. -f1)"
 	export _LANGUAGE
 
-	if [ -z "${_SET_LOCALE}" ]
-	then
-		# Actually, we should check here if the locale is generated
-		return
-	fi
-
 	if echo "${_LOCALE}" | grep -sqE '^[[:lower:]]{2}$'
 	then
-		# input is like "locale=ch", so we will convert and setup also the keyboard if not already set
+		# input is like "locales=ch", so we will convert and setup also the keyboard if not already set
 		if [ -z "${_KEYBOARD}" ]
 		then
 			_KEYBOARD="${_LOCALE}"

-- 
live-config



More information about the debian-live-changes mailing list