[SCM] debian-live/live-initramfs branch, master, updated. 1.128.1-1-6-gc1936d7

Daniel Baumann daniel at debian.org
Wed Apr 16 07:02:56 UTC 2008


The following commit has been merged in the master branch:
commit c1936d760ad21a0655cf6857c8f339651ed60704
Author: Daniel Baumann <daniel at debian.org>
Date:   Wed Apr 16 09:02:46 2008 +0200

    Merging casper 1.130.

diff --git a/debian/control b/debian/control
index 3836a66..6ff07ed 100644
--- a/debian/control
+++ b/debian/control
@@ -12,7 +12,7 @@ XS-Upstream-Depends: git-core
 
 Package: live-initramfs
 Architecture: all
-Depends: ${misc:Depends}, busybox, file, initramfs-tools, sudo, udev, user-setup
+Depends: ${misc:Depends}, busybox, file, initramfs-tools, localechooser-data, sudo, udev, user-setup
 Recommends: eject, uuid-runtime, wget
 Suggests: genext2fs (>= 1.4.1), squashfs-tools, mtd-tools
 Description: Debian Live initramfs hook
diff --git a/docs/ChangeLog.casper b/docs/ChangeLog.casper
index 34e0bd0..6bc93d9 100644
--- a/docs/ChangeLog.casper
+++ b/docs/ChangeLog.casper
@@ -1,3 +1,10 @@
+casper (1.130) hardy; urgency=low
+
+  * Handle use of debian-installer/language for locale selection
+    (LP: #213930).
+
+ -- Colin Watson <cjwatson at ubuntu.com>  Sat, 12 Apr 2008 00:30:10 +0100
+
 casper (1.129) hardy; urgency=low
 
   * Add COPYING file with GPL text (LP: #211923).
diff --git a/scripts/live b/scripts/live
index 46dcb74..240691a 100755
--- a/scripts/live
+++ b/scripts/live
@@ -154,6 +154,12 @@ Arguments ()
 				export LIVE_MEDIA_TIMEOUT
 				;;
 
+			language=*|debian-installer/language=*)
+				language=${x#debian-installer/language=}
+				locale="$(lang2locale "$language")"
+				set_locale="true"
+				;;
+
 			locale=*|debian-installer/locale=*)
 				LOCALE="${ARGUMENT#*=}"
 				export LOCALE
diff --git a/scripts/live-functions b/scripts/live-functions
index 964fdf0..b6d04fb 100644
--- a/scripts/live-functions
+++ b/scripts/live-functions
@@ -29,3 +29,32 @@ really_export ()
 
 	eval export "${STRING}"="${VALUE}"
 }
+
+lang2locale() {
+	langpart="${1%%_*}"
+	if [ "$1" != "C" ]; then
+		# Match the language code with 3rd field in languagelist
+		line=$(grep -v "^#" /root/usr/share/localechooser/languagelist | cut -f3,4,5 -d\; | grep -v ';C$' | grep "^$langpart;")
+		if [ -n "$line" ]; then
+			if [ "$(echo "$line" | grep -c '')" -gt 1 ]; then
+				# More than one match; try matching the
+				# country as well.
+				countrypart="${1#*_}"
+				if [ "$countrypart" = "$1" ]; then
+					countryline="$(echo "$line" | head -n1)"
+					echo "${countryline##*;}"
+					return
+				fi
+				countrypart="${countrypart%%[@.]*}"
+				countryline="$(echo "$line" | grep ";$countrypart;" | head -n1 || true)"
+				if [ "$countryline" ]; then
+					echo "${countryline##*;}"
+					return
+				fi
+			fi
+			echo "${line##*;}"
+		fi
+	else
+		echo "C"
+	fi
+}

-- 
debian-live/live-initramfs



More information about the debian-live-changes mailing list