doinst.sh 978 B

123456789101112131415161718192021222324252627282930313233343536
  1. config() {
  2. NEW="$1"
  3. OLD="$(dirname $NEW)/$(basename $NEW .new)"
  4. # If there's no config file by that name, mv it over:
  5. if [ ! -r $OLD ]; then
  6. mv $NEW $OLD
  7. elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
  8. # toss the redundant copy
  9. rm $NEW
  10. fi
  11. # Otherwise, we leave the .new copy for the admin to consider...
  12. }
  13. schema_install() {
  14. SCHEMA="$1"
  15. GCONF_CONFIG_SOURCE="xml::etc/gconf/gconf.xml.defaults" \
  16. chroot . gconftool-2 --makefile-install-rule \
  17. /etc/gconf/schemas/$SCHEMA \
  18. 1>/dev/null
  19. }
  20. config etc/gnashpluginrc.new
  21. config etc/gnashthumbnailrc.new
  22. config etc/gnashrc.new
  23. schema_install gnash.schemas
  24. if [ -x /usr/bin/update-desktop-database ]; then
  25. /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
  26. fi
  27. if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
  28. if [ -x /usr/bin/gtk-update-icon-cache ]; then
  29. /usr/bin/gtk-update-icon-cache -f usr/share/icons/hicolor >/dev/null 2>&1
  30. fi
  31. fi