Skip to content

Commit

Permalink
Merging casper 1.130.
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-baumann committed Apr 16, 2008
1 parent f213f2a commit 2230ff3
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 1 deletion.
2 changes: 1 addition & 1 deletion debian/control
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions 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@ubuntu.com> Sat, 12 Apr 2008 00:30:10 +0100

casper (1.129) hardy; urgency=low

* Add COPYING file with GPL text (LP: #211923).
Expand Down
6 changes: 6 additions & 0 deletions scripts/live
Expand Up @@ -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
Expand Down
29 changes: 29 additions & 0 deletions scripts/live-functions
Expand Up @@ -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
}

0 comments on commit 2230ff3

Please sign in to comment.