File: preinst

package info (click to toggle)
super 3.30.0-3+squeeze2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 1,088 kB
  • ctags: 755
  • sloc: ansic: 10,089; sh: 288; makefile: 201
file content (35 lines) | stat: -rw-r--r-- 901 bytes parent folder | download | duplicates (2)
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
#!/bin/sh

set -e 

if [ "$1" = "upgrade" -a -d /var/lib/superstamps ] && 
    dpkg --compare-versions "$2" lt "3.18.0-2" ; then
 	echo -n "Moving old /var/lib/superstamps dir into /var/run..."
	rm -rf /var/run/superstamps
	mv -f /var/lib/superstamps /var/run
	echo "OK"
fi	

# Handle our old cron script
if [ "$1" = "upgrade" -a -e /etc/cron.weekly/super ] ; then
 if dpkg --compare-versions "$2" lt "3.14.0" >/dev/null 2>&1; then
	if echo 'de938b7353b549cb3390b45dfd38bc1a  /etc/cron.weekly/super' \
	   | md5sum -c >/dev/null 2>&1; then
		# not modified, remove it
		echo -n  "Removing obsolete /etc/cron.weekly/super..."
		rm -f /etc/cron.weekly/super
		echo "OK"
		
	else 
		# modified
		echo -n "Saving obsolete /etc/cron.weekly/super "
		echo -n "as /etc/cron.weekly/super.dpkg-old..."
		mv -f /etc/cron.weekly/super /etc/cron.weekly/super.dpkg-old
		echo "OK"
	fi
  fi
fi

#DEBHELPER#

exit 0