home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / var / lib / dpkg / info / scim.postinst < prev    next >
Encoding:
Text File  |  2009-03-09  |  2.7 KB  |  93 lines

  1. #! /bin/sh
  2. # postinst script for scim
  3. #
  4. # see: dh_installdeb(1)
  5.  
  6. set -e
  7.  
  8. # summary of how this script can be called:
  9. #        * <postinst> `configure' <most-recently-configured-version>
  10. #        * <old-postinst> `abort-upgrade' <new version>
  11. #        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
  12. #          <new-version>
  13. #        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
  14. #          <failed-install-package> <version> `removing'
  15. #          <conflicting-package> <version>
  16. # for details, see http://www.debian.org/doc/debian-policy/ or
  17. # the debian-policy package
  18. #
  19. # quoting from the policy:
  20. #     Any necessary prompting should almost always be confined to the
  21. #     post-installation script, and should be protected with a conditional
  22. #     so that unnecessary prompting doesn't happen if a package's
  23. #     installation fails and the `postinst' is called with `abort-upgrade',
  24. #     `abort-remove' or `abort-deconfigure'.
  25. ua_inst () {
  26.     update-alternatives \
  27.         --install /etc/X11/xinit/xinput.d/$1 xinput-$1 \
  28.         /etc/X11/xinit/xinput.d/$2 $3 ;
  29. }
  30.  
  31. # If u-a is in manual mode as a result of the bug in
  32. # 1.4.7-3ubuntu1, reset it back to auto.
  33. # Also forcefully remove the scim-bridge entry from xinput_all-ALL in u-a.
  34. if dpkg --compare-versions "$2" ge 1.4.7-3ubuntu1 \
  35.    && dpkg --compare-versions "$2" lt-nl 1.4.7-3ubuntu5
  36. then
  37.     for conf in ja_JP ko_KR zh_CN zh_HK zh_SG zh_TW all_ALL
  38.     do
  39.         if LC_ALL=C update-alternatives --display xinput-${conf} \
  40.            | grep -q 'status is manual' \
  41.            && LC_ALL=C update-alternatives --display xinput-${conf} \
  42.            | grep -q 'currently points to .*scim-bridge'
  43.         then
  44.             update-alternatives --auto xinput-${conf}
  45.         fi
  46.     done
  47.     if LC_ALL=C update-alternatives --display xinput-all_ALL \
  48.        | grep -q 'currently points to .*scim-bridge'
  49.     then 
  50.         update-alternatives --remove xinput-all_ALL \
  51.            /etc/X11/xinit/xinput.d/scim-bridge
  52.     fi
  53. fi
  54.  
  55. case "$1" in
  56.     configure)
  57.  
  58.         # Set up default
  59.         #ua_inst all_ALL scim  0
  60.         ua_inst ja_JP   scim 50
  61.         ua_inst ko_KR   scim 50
  62.         ua_inst zh_CN   scim 50
  63.         ua_inst zh_TW   scim 50
  64.         ua_inst zh_HK   scim 50
  65.         ua_inst zh_SG   scim 50
  66.         #ua_inst all_ALL scim-immodule 0
  67.         ua_inst ja_JP   scim-immodule 0
  68.         ua_inst ko_KR   scim-immodule 0
  69.         ua_inst zh_CN   scim-immodule 0
  70.         ua_inst zh_TW   scim-immodule 0
  71.         ua_inst zh_HK   scim-immodule 0
  72.         ua_inst zh_SG   scim-immodule 0
  73.     ;;
  74.  
  75.     abort-upgrade|abort-remove|abort-deconfigure)
  76.  
  77.     ;;
  78.  
  79.     *)
  80.         echo "postinst called with unknown argument \`$1'" >&2
  81.         exit 1
  82.     ;;
  83. esac
  84.  
  85. # dh_installdeb will replace this with shell code automatically
  86. # generated by other debhelper scripts.
  87.  
  88.  
  89.  
  90. exit 0
  91.  
  92.  
  93.