blob: 2c758c265d138c53823d9cbf13b6a648a241b839 (
plain)
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
|
PRELOAD_STATE=/var/lib/preload/preload.state
# arg 1: the new package version
# arg 2: the old package version
pre_upgrade() {
if [ `vercmp $2 0.6.3-2` -lt 0 ]; then
echo "Backing up your state file..."
cp -af ${PRELOAD_STATE} ${PRELOAD_STATE}.backup
fi
}
# arg 1: the new package version
# arg 2: the old package version
post_upgrade() {
if [ `vercmp $2 0.6.3-2` -lt 0 -a -f ${PRELOAD_STATE}.backup ]; then
echo "Restoring the state file..."
mv -f ${PRELOAD_STATE}.backup ${PRELOAD_STATE}
fi
}
# arg 1: the old package version
post_remove() {
echo
echo "Leaving ${PRELOAD_STATE} intact in case one day you want to"
echo "install preload again. If you are sure you don't need it anymore, please"
echo "remove it manually. Log files in /var/log have not been removed as well."
echo
}
# vim:set ts=2 sw=2 et:
|