| 1 |
#! /bin/sh |
| 2 |
set -e |
| 3 |
|
| 4 |
#export DEBCONF_DEBUG=developer |
| 5 |
|
| 6 |
# Source debconf library. |
| 7 |
. /usr/share/debconf/confmodule |
| 8 |
|
| 9 |
if [ "$1" = configure ] |
| 10 |
then |
| 11 |
# (Re)move old scorefile and directory if it exists |
| 12 |
if [ -e /var/lib/games/moon-buggy/mbscore ] |
| 13 |
then |
| 14 |
|
| 15 |
# If mbscore.old already exists in the new location, rename that one to |
| 16 |
# very_old, do not care about other very_old files (they should not even be |
| 17 |
# here!) |
| 18 |
if [ -e /var/games/moon-buggy/mbscore.old ] |
| 19 |
then |
| 20 |
mv /var/games/moon-buggy/mbscore.old /var/games/moon-buggy/mbscore.very_old |
| 21 |
fi |
| 22 |
|
| 23 |
# save the old score file as mbscore.old in the new scorefile location |
| 24 |
mv /var/lib/games/moon-buggy/mbscore /var/games/moon-buggy/mbscore.old |
| 25 |
|
| 26 |
# remove other files at old scorefile location, nothing else should be here |
| 27 |
# anyway |
| 28 |
rm -rf /var/lib/games/moon-buggy |
| 29 |
fi |
| 30 |
|
| 31 |
# some people think moon-buggy should not even try to delete this directory. |
| 32 |
# complain to them if your harddisk fills with cruft directories from FHS |
| 33 |
# changes |
| 34 |
## remove leftover directories |
| 35 |
# if [ -d /var/lib/games ] |
| 36 |
# then |
| 37 |
## also delete /var/lib/games if no other files are present |
| 38 |
# rmdir /var/lib/games |
| 39 |
# fi |
| 40 |
|
| 41 |
# make sure the score file is owned by root.games |
| 42 |
if [ -d /var/games/moon-buggy ] |
| 43 |
then |
| 44 |
/usr/games/moon-buggy -c |
| 45 |
chown root:games /var/games/moon-buggy/mbscore |
| 46 |
chmod 664 /var/games/moon-buggy/mbscore |
| 47 |
# this directory better exists... its part of the package |
| 48 |
else |
| 49 |
echo "The directory for the score files does not exist? Please file a bug." |
| 50 |
exit 1; |
| 51 |
fi |
| 52 |
fi |
| 53 |
|
| 54 |
#DEBHELPER# |