updated on Tue Jan 10 04:01:21 UTC 2012
[aur-mirror.git] / sokobano / sokobano.install
blobfc84720a8913400a56cbcc570e31b7875442708a
1 post_install() {
2 # Prevent overwriting 
3 # - configuration files
4 if [ ! -d /opt/sokobano/res/config ]; then
5    mv /opt/sokobano/res/config.new /opt/sokobano/res/config
6 else
7    rm -r /opt/sokobano/res/config.new
8 fi
9 if [ ! -d /opt/sokobano/res/player ]; then
10    mv /opt/sokobano/res/player.new /opt/sokobano/res/player
11 else
12    rm -r /opt/sokobano/res/player.new
14 # - high scores
15 if [ ! -e /opt/sokobano/res/levelSet/0/highScores.xml ]; then
16    for _i in {0..6}; do
17       mv -T /opt/sokobano/res/levelSet/$_i/highScores.xml.new /opt/sokobano/res/levelSet/$_i/highScores.xml
18    done
19 else
20    rm -r /opt/sokobano/res/levelSet/*/highScores.xml.new
22 cat << EOM
23 -------------------------------
24  In order to play Sokobano, add your user to the 'games' group.
25   # gpasswd -a USERNAME games
26  Remember to logout and log back in for the changes to take effect.
27 -------------------------------
28 EOM
30 post_upgrade() {
31 # Remove useless files and directories
32 rm -r /opt/sokobano/res/{config.new,player.new}
33 rm /opt/sokobano/res/levelSet/*/highScores.xml.new