preinst is in evolution 3.10.4-0ubuntu1.
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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | #! /bin/sh
set -e
. /usr/share/debconf/confmodule
EVO_PROCESS='evolution|/usr/lib/evolution/.*/evolution-exchange-storage|/usr/lib/evolution/evolution-data-server-.*'
error_msg() {
db_title Upgrading evolution
db_fset evolution/needs_shutdown seen false
db_input high evolution/needs_shutdown || true
db_go
}
end_msg() {
db_title Evolution processes still present
db_input high evolution/kill_processes || true
db_fset evolution/kill_processes seen false
db_go
}
upgrade_check() {
seen=0
while pgrep -fx ${EVO_PROCESS} > /dev/null; do
seen=$(($seen + 1))
if [ $seen -lt 4 ];
then
error_msg
fi
if [ $seen = 3 ]; then
end_msg
db_get evolution/kill_processes
if [ "$RET" = "Abort" ];
then
db_stop
echo "Evolution is still running, aborting..."
exit 1
else
# proceed with the upgrade, try to kill any remaining evolution process
# before
echo "Evolution is still running but proceeding with the upgrade..."
pkill -fx ${EVO_PROCESS} > /dev/null
fi
fi
if [ $seen = 4 ]; then
# means we choose to proceed and tried to kill evo process but failed for
# some reason. Try harder, then continue anyway
db_stop
pkill -9 -fx ${EVO_PROCESS} > /dev/null
return
fi
done
db_stop
echo "No more Evolution instances running, proceeding with the upgrade..."
}
if dpkg --compare-versions "$2" lt-nl 2.24; then
upgrade_check
fi
|