gconfpkg 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/bin/sh
  2. usage() {
  3. cat << _EOF
  4. Usage:
  5. gconfpkg [OPTION] [PACKAGE]
  6. Help Options:
  7. -?, --help Show help options
  8. Application Options:
  9. --install Install schemas for a given package
  10. --uninstall Uninstall schemas for a given package
  11. _EOF
  12. }
  13. install() {
  14. GCONF_CONFIG_SOURCE=`/usr/bin/gconftool-2 --get-default-source` \
  15. /usr/bin/gconftool-2 --makefile-install-rule /usr/share/gconf/schemas/${pkgname}.schemas >/dev/null
  16. }
  17. uninstall() {
  18. if [ -f /usr/share/gconf/schemas/${pkgname}.schemas ]; then
  19. schemas=/usr/share/gconf/schemas/${pkgname}.schemas
  20. elif [ -f /opt/gnome/share/gconf/schemas/${pkgname}.schemas ]; then
  21. schemas=/opt/gnome/share/gconf/schemas/${pkgname}.schemas
  22. else
  23. schemas=`pacman -Ql ${pkgname} | grep 'gconf/schemas/.*schemas$' | awk '{ print $2 }'`
  24. fi
  25. GCONF_CONFIG_SOURCE=`/usr/bin/gconftool-2 --get-default-source` \
  26. /usr/bin/gconftool-2 --makefile-uninstall-rule ${schemas} >/dev/null
  27. }
  28. if [ -z "$2" ]; then
  29. usage
  30. else
  31. pkgname="$2"
  32. case "$1" in
  33. --install)
  34. install
  35. ;;
  36. --uninstall)
  37. uninstall
  38. ;;
  39. *)
  40. usage
  41. ;;
  42. esac
  43. fi