X-Git-Url: http://git.grml.org/?a=blobdiff_plain;ds=sidebyside;f=scripts%2Flive-functions;h=c5055a0a642c14458eb7fc708d10178c77e01826;hb=3ffb848024ced8a2eea2f14d81a7ce51a216f47d;hp=baa920c7660663c966a7cca4c0c2466f87f88560;hpb=cb896241d0ec8eb2bba0cecd11de3500869176a6;p=live-boot-grml.git diff --git a/scripts/live-functions b/scripts/live-functions index baa920c..c5055a0 100644 --- a/scripts/live-functions +++ b/scripts/live-functions @@ -3,27 +3,16 @@ . /scripts/functions . /live.vars -log_end_msg () -{ - # Override this so we don't call PROGRESS - if [ -x /sbin/usplash_write ] - then - /sbin/usplash_write "SUCCESS ok" - fi - - _log_msg "Done." -} - log_wait_msg () { # Print a message and wait for enter if [ -x /sbin/usplash_write ] then - /sbin/usplash_write "INPUTENTER $@" + /sbin/usplash_write "INPUTENTER ${@}" read nunya < /dev/.initramfs/usplash_outfifo fi - _log_msg "Waiting: $@ ..." + _log_msg "Waiting: ${@} ..." } really_export () @@ -40,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/live-initramfs/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 +}