updated on Thu Jan 26 00:18:00 UTC 2012
[aur-mirror.git] / dwarffortress-ironhand / dwarffortress-ih.install
blobedf23c7837452e4593e36266f0b94e014dcd3a93
1 ## arg 1:  the new package version
2 post_install() {
3   echo "Make sure to add your user to the games group to play dwarffortress"
4   post_upgrade $1 0
7 ## arg 1:  the new package version
8 ## arg 2:  the old package version
9 post_upgrade() {
10   #may need to update savegames
11   if [ ! `vercmp $2 $1` -eq 1 ]; then
12     echo "Raws might have changed. Do you want to update your savegames? [y/N]"
13     read -n 1 choice
14     if [[ ("${choice}" == "y") || ("${choice}" == "Y") ]]; then
15       for dir in $(find /opt/df_linux-ih/data/save/ -type d); do
16         if [ -d "${dir}/raw" ]; then
17           echo "Upgrading save ${dir}"
18           cp -rf /opt/df_linux-ih/raw "${dir}/"
19         fi
20       done
21     fi
22   fi
24   # Make sure that permissions are correct
25   chown -R root:games /opt/df_linux-ih/data
26   find /opt/df_linux-ih/data/save -type d -exec chmod 775 {} + &
27   find /opt/df_linux-ih/data/save -type f -exec chmod 664 {} + &
28   
31 # vim:set ts=2 sw=2 et: