File: postinst

package info (click to toggle)
bastet 0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 336 kB
  • ctags: 256
  • sloc: cpp: 1,544; sh: 45; makefile: 23
file content (37 lines) | stat: -rw-r--r-- 675 bytes parent folder | download | duplicates (7)
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
#! /bin/sh
# postinst script for bastet

set -e

scores=/var/games/bastet.scores2
oldscores=/var/games/bastet.scores

deal_with_old_score_file () 
{
  if [ "$1" = "remove" ] ; then
    rm $oldscores
  fi
}

# old version of bastet (< 0.41-6) will remove high score file
# on upgrade, so rescue it
if $(dpkg --compare-versions "$2" lt-nl 0.41-6) && [ -e "$oldscores.tmp" ] ; then
  mv "$oldscores.tmp" "$oldscores"
fi
if [ ! -e "$scores" ] ; then

  touch "$scores"
  chgrp games "$scores"
  chmod 664 "$scores"
fi

. /usr/share/debconf/confmodule

if [ -e "$oldscores" ] ; then
  db_get bastet/score_file_compatibility
  deal_with_old_score_file $RET
fi

#DEBHELPER#

exit 0