Want more features on Pastebin? Sign Up, it's FREE!
Guest

tutka.install

By: a guest on Feb 2nd, 2011  |  syntax: None  |  size: 1.02 KB  |  views: 77  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. pkgname=tutka
  2.  
  3. post_install() {
  4.   export GCONF_CONFIG_SOURCE=`usr/bin/gconftool-2 --get-default-source`
  5.   usr/bin/gconftool-2 --makefile-install-rule usr/share/gconf/schemas/${pkgname}.schemas >/dev/null
  6.   gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
  7.   update-desktop-database -q
  8. }
  9.  
  10. pre_upgrade() {
  11.   pre_remove $1
  12. }
  13.  
  14. post_upgrade() {
  15.   post_install $1
  16. }
  17.  
  18. pre_remove() {
  19.   if [ -f usr/share/gconf/schemas/${pkgname}.schemas ]; then
  20.     schemas=(usr/share/gconf/schemas/${pkgname}.schemas)
  21.   elif [ -f opt/gnome/share/gconf/schemas/${pkgname}.schemas ]; then
  22.     schemas=(opt/gnome/share/gconf/schemas/${pkgname}.schemas)
  23.   else
  24.     schemas=(`pacman -Ql $pkgname | grep 'gconf/schemas/.*schemas$' | awk '{ print $2 }'`)
  25.   fi
  26.   export GCONF_CONFIG_SOURCE=`usr/bin/gconftool-2 --get-default-source`
  27.  
  28.   usr/bin/gconftool-2 --makefile-uninstall-rule ${schemas[@]} >/dev/null
  29. }
  30.  
  31. post_remove() {
  32.   gtk-update-icon-cache -q -t -f usr/share/icons/hicolor
  33.   update-desktop-database -q
  34. }
  35.  
  36. op=$1
  37. shift
  38.  
  39. $op $*
clone this paste RAW Paste Data