preinst is in moria 5.6.debian.1-2build2.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
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 | #!/bin/sh -e
# Shamelessly stolen from Joey Hess' bsdgames-2.12-9
SCOREFILES="/var/games/moria/scores"
# We used to keep score files in /var/lib/games, and if files are there,
# move them into the new location.
if [ -d /var/lib/games ]; then
# Have to set up directory hierarchy, since this is running as a
# preinst.
mkdir -p /var/games/moria
chown root:games /var/games/moria
chmod g+rws /var/games/moria
for file in $SCOREFILES; do
oldfile=`echo $file | sed s:/var/games/:/var/lib/games/:`
if [ -e $oldfile ]; then
if [ ! -e $file ]; then
mv -f $oldfile $file
else
rm -f $oldfile
fi
fi
done
# Delete the old directory hierarchy.
rm -rf /var/lib/games/moria
fi
|