1 2 3 4 5 6 7 8 9 10 11 12
pre_upgrade() { if(test `vercmp '3.4.3-5' "$2"` -ge 0); then mv /usr/share/nethack /tmp/nethack-backup fi } post_upgrade() { if(test `vercmp '3.4.3-5' "$2"` -ge 0); then rm -rf /var/games/nethack mv /tmp/nethack-backup /var/games/nethack fi }