doinst.sh 767 B

123456789101112131415161718192021222324252627
  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. if [ -x /usr/bin/update-desktop-database ]; then
  14. /usr/bin/update-desktop-database usr/share/applications >/dev/null 2>&1
  15. fi
  16. if [ -x /usr/bin/update-mime-database ]; then
  17. /usr/bin/update-mime-database usr/share/mime >/dev/null 2>&1
  18. fi
  19. if [ -x /usr/bin/gtk-update-icon-cache ] \
  20. && [ -e usr/share/icons/hicolor/icon-theme.cache ]; then
  21. /usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1
  22. fi