postrm 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #!/bin/sh
  2. # Post-remove script for ‘bsdgames’ package.
  3. #
  4. # Man page: ‘dh_installdeb(1)’
  5. set -e
  6. # Summary of ways this script can be called:
  7. # * <postrm> ‘remove’
  8. # * <postrm> ‘purge’
  9. # * <old-postrm> ‘upgrade’ <new-version>
  10. # * <disappearer's-postrm> ‘disappear’ <overwriter> <overwriter-version>
  11. # * <new-postrm> ‘failed-upgrade’ <old-version>
  12. # * <new-postrm> ‘abort-install’
  13. # * <new-postrm> ‘abort-install’ <old-version>
  14. # * <new-postrm> ‘abort-upgrade’ <old-version>
  15. # For details, see <URL:http://www.debian.org/doc/debian-policy/> or
  16. # the ‘debian-policy’ package.
  17. action="$1"
  18. SCOREFILES="
  19. /var/games/bsdgames/atc_score
  20. /var/games/bsdgames/battlestar.log
  21. /var/games/bsdgames/cfscores
  22. /var/games/bsdgames/criblog
  23. /var/games/bsdgames/robots_roll
  24. /var/games/bsdgames/saillog
  25. /var/games/bsdgames/snake.log
  26. /var/games/bsdgames/snakerawscores
  27. /var/games/bsdgames/tetris-bsd.scores
  28. /var/games/bsdgames/phantasia/characs
  29. /var/games/bsdgames/phantasia/gold
  30. /var/games/bsdgames/phantasia/lastdead
  31. /var/games/bsdgames/phantasia/mess
  32. /var/games/bsdgames/phantasia/motd
  33. /var/games/bsdgames/phantasia/scoreboard
  34. /var/games/bsdgames/phantasia/void
  35. /var/games/bsdgames/phantasia/monsters
  36. /var/games/bsdgames/hack/perm
  37. /var/games/bsdgames/hack/record"
  38. # Remove high score files on purge.
  39. if [ "$1" = "purge" ]; then
  40. rm -f $SCOREFILES
  41. rmdir /var/games/bsdgames/phantasia /var/games/bsdgames/sail \
  42. /var/games/bsdgames /var/games 2>/dev/null || true
  43. rm -f /var/games/bsdgames/hack/save/* 2>/dev/null || true
  44. rmdir -p /var/games/bsdgames/hack/save 2>/dev/null || true
  45. fi
  46. case "$action" in
  47. remove|purge|upgrade|disappear|failed-upgrade|abort-install|abort-upgrade)
  48. ;;
  49. *)
  50. printf "postrm called with unknown action ‘%s’\n" "$action" >&2
  51. exit 1
  52. ;;
  53. esac
  54. #DEBHELPER#
  55. exit 0