preinst is in phpbb3 3.0.9-1.
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 | #!/bin/sh
# preinst script for phpbb3
# By J.M.Roth <jmroth@iip.lu>
#
# runs before new files are unpacked
# comes in handy when e.g. directories need to be relocated before being
# automatically deleted by the new install, where they no longer exist
#
# possible calls: install, upgrade, abort-upgrade
set -e
if [ "$1" = "upgrade" ]; then
if dpkg --compare-versions "$2" lt-nl "3.0.7-PL1-1"; then
# move images folder to /var/lib/phpbb3/
# debian policy 6.6: dirs cannot be changed to symlinks or vice-versa
# so we move (delete) the stuff here
# and install the symlink in postinst
# (we cannot install the symlink via dpkg!)
[ -L /usr/share/phpbb3/www/images/avatars ] && rm /usr/share/phpbb3/www/images/avatars
mv /usr/share/phpbb3/www/images /var/lib/phpbb3/
cp -a /var/lib/phpbb3/avatars /var/lib/phpbb3/images/ && rm -Rf /var/lib/phpbb3/avatars
rm -rf /usr/share/phpbb3/schemas
# @TODO maybe care for abort-upgrade?
fi
fi
|