From: Daniel Baumann Date: Wed, 16 Apr 2008 07:02:46 +0000 (+0200) Subject: Merging casper 1.130. X-Git-Tag: debian/2.0.15-1~557 X-Git-Url: http://git.grml.org/?a=commitdiff_plain;h=9863b7ac3829367dfa144a0bdaf812b39362d264;p=live-boot-grml.git 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 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 +}