File: preinst

package info (click to toggle)
nethack 3.2.3-3
  • links: PTS
  • area: main
  • in suites: slink
  • size: 9,960 kB
  • ctags: 14,316
  • sloc: ansic: 155,139; asm: 2,412; yacc: 2,002; makefile: 887; lex: 412; sh: 160
file content (38 lines) | stat: -rw-r--r-- 918 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh

# Nethack pre-installation script for Debian
#
# Ben Gertzfield (che@debian.org) 29 July 1997
# Copyright 1997 Ben Gertzfield. This script is released under the
# GNU General Public License, version 2 or later.

set -e

if [ $1 != "configure" ] ; then
  exit 0
fi

dpkg --compare-versions $2 lt-nl 3.2.2 || exit 0

cat <<EOF
You seem to have a version of Nethack prior to this package's version,
which is 3.2.2. Unfortunately, the save files and high scores that
older versions used are incompatible with this version, and will be
cleared if you continue installing this package.

If you want to save these, back up /var/lib/games/nethack now!

EOF

echo -n "Do you want to continue? (Y/n) "
read answer

if [ "$answer" = "n" -o "$answer" = "N" ] ; then
    echo "Aborting installation of Nethack."
    exit 1
else
    echo "Removing old save files and high scores.."
    rm -rf /var/lib/games/nethack
fi