home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / lib / ubiquity / localechooser / finish-install < prev    next >
Encoding:
Text File  |  2006-08-30  |  3.3 KB  |  107 lines

  1. #! /bin/sh
  2.  
  3. set -e
  4.  
  5. . /usr/share/debconf/confmodule
  6.  
  7. ARCH=`udpkg --print-architecture`
  8.  
  9. modify_cyrconfig() {
  10.     if [ "$2" ]; then
  11.         sed -e "s/^$1 .*\$/$1 $2/" \
  12.             $cyrconfig > $cyrconfig.tmp && \
  13.             mv $cyrconfig.tmp $cyrconfig
  14.     fi
  15. }
  16.  
  17. db_get debian-installer/locale
  18. LOCALE="$RET"
  19.  
  20. # Set locale to C if it has not yet been set
  21. # This can happen during e.g. s390 installs where localechooser is not run
  22. [ -z "$LOCALE" ] && LOCALE="C"
  23.  
  24. LANGUAGE=${LOCALE%%_*}
  25.  
  26. # Install specific packages depending on selected language
  27.  
  28. if [ "$LOCALE" != "C" ] ; then
  29.     # Other language specific packages
  30.     case "$LANGUAGE" in
  31.         ar|he|fa)
  32.         # RTL languages (Arabic, Hebrew, Farsi)
  33.         apt-install libfribidi0 || true
  34.         ;;
  35.     esac
  36. fi
  37.  
  38. # Install localization-config except when no localization happens
  39. # Install it anyway for powerpc (to handle subarches)
  40. if [ "$LOCALE" != "C" ] || [ "$ARCH" = "powerpc" ]; then
  41.         apt-install localization-config || true
  42. fi
  43.  
  44.  
  45. db_get debian-installer/consoledisplay || true
  46. consoletype=`echo $RET | sed -e 's/=.*$//'`
  47. case "$consoletype" in
  48.     kbd)
  49.     consolefont=`echo $RET | sed -e 's/^kbd=//'`
  50.     if apt-install console-tools; then
  51.         ctconfig=/target/etc/console-tools/config
  52.         acm=`echo $consolefont | sed -e 's/.*(//' -e 's/).*//'`
  53.         [ "$acm" = utf8 ] && acm=
  54.         # A few workarounds of console-tools limitations below
  55.         # APP_CHARSET_MAP and console fonts are not set
  56.         # for all consoles. These workarounds should probably
  57.         # be removed when we switch to kbd
  58.         if [ -n "$acm" ]; then
  59.             echo "APP_CHARSET_MAP=$acm" >>$ctconfig
  60.             echo "APP_CHARSET_MAP_vc1=$acm" >>$ctconfig
  61.             echo "APP_CHARSET_MAP_vc2=$acm" >>$ctconfig
  62.             echo "APP_CHARSET_MAP_vc3=$acm" >>$ctconfig
  63.             echo "APP_CHARSET_MAP_vc4=$acm" >>$ctconfig
  64.             echo "APP_CHARSET_MAP_vc5=$acm" >>$ctconfig
  65.             echo "APP_CHARSET_MAP_vc6=$acm" >>$ctconfig
  66.         fi
  67.         consolefont=`echo $consolefont | sed -e 's/(.*//'`
  68.         if [ -n "$consolefont" ]; then
  69.             echo "SCREEN_FONT=$consolefont" >>$ctconfig
  70.             echo "SCREEN_FONT_vc2=$consolefont" >>$ctconfig
  71.             echo "SCREEN_FONT_vc3=$consolefont" >>$ctconfig
  72.             echo "SCREEN_FONT_vc4=$consolefont" >>$ctconfig
  73.             echo "SCREEN_FONT_vc5=$consolefont" >>$ctconfig
  74.             echo "SCREEN_FONT_vc6=$consolefont" >>$ctconfig
  75.         fi
  76.         if echo "$consolefont" | grep -q "Terminus"; then
  77.             apt-install console-terminus || true
  78.         fi
  79.     fi
  80.     ;;
  81.     cyr)
  82.     consolefont=`echo $RET | sed -e 's/^cyr=//'`
  83.     if apt-install console-cyrillic; then
  84.         cyrconfig=/target/etc/console-cyrillic
  85.         # format of the consolefont is:
  86.         # style,size,encoding,layout(option1 option2)
  87.         style=`echo $consolefont | sed -e 's/,.*$//'`
  88.         size=`echo $consolefont | sed -e 's/^[^,]*,\([^,]*\),.*$/\1/'`
  89.         encoding=`echo $consolefont | sed -e 's/^[^,]*,[^,]*,\([^,]*\),.*$/\1/'`
  90.         layoutopts=`echo $consolefont | sed -e 's/^[^,]*,[^,]*,[^,]*,\([^)]*)\).*$/\1/'`
  91.         layout=`echo $layoutopts | sed -e 's/(.*)$//'`
  92.         options=`echo $layoutopts | sed -e 's/.*(//' -e 's/).*//'`
  93.         modify_cyrconfig style "$style"
  94.         modify_cyrconfig size "$size"
  95.         modify_cyrconfig encoding "$encoding"
  96.         modify_cyrconfig layout "$layout"
  97.         modify_cyrconfig options "$options"
  98.         sed -e 's/^.*Bootsetup: .*$/# Bootsetup: YES/' $cyrconfig > $cyrconfig.tmp && \
  99.             mv $cyrconfig.tmp $cyrconfig
  100.         sed -e 's/^.*Debconf: .*$/# Debconf: NO/' $cyrconfig > $cyrconfig.tmp && \
  101.             mv $cyrconfig.tmp $cyrconfig
  102.     fi
  103.     ;;
  104. esac
  105.  
  106. exit 0
  107.