summaryrefslogtreecommitdiff
path: root/community/preload/preload.install
diff options
context:
space:
mode:
authorParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
committerParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
commit415856bdd4f48ab4f2732996f0bae58595092bbe (patch)
treeede2018b591f6dfb477fe9341ba17b9bc000fab9 /community/preload/preload.install
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'community/preload/preload.install')
-rw-r--r--community/preload/preload.install30
1 files changed, 30 insertions, 0 deletions
diff --git a/community/preload/preload.install b/community/preload/preload.install
new file mode 100644
index 000000000..2c758c265
--- /dev/null
+++ b/community/preload/preload.install
@@ -0,0 +1,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: