File: postinst

package info (click to toggle)
sysnews 0.9-13
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 124 kB
  • ctags: 85
  • sloc: ansic: 974; makefile: 74; sh: 28
file content (25 lines) | stat: -rw-r--r-- 764 bytes parent folder | download | duplicates (3)
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
#!/bin/sh -e

#DEBHELPER#

# This directory needs to move.
if dpkg --compare-versions 0.9-8 gt "$2"; then
	# See preinst..
	if [ -d /var/tmp/.sysnews_WELCOME_deleted ]; then
		rm -f /var/lib/sysnews/WELCOME
		rmdir /var/tmp/.sysnews_WELCOME_deleted
	fi

	if [ -d /var/news ]; then
	        find /var/news -mindepth 1 -exec mv -f {} /var/lib/sysnews/ \;
		rm -rf /var/news
	fi
fi

# If the file is an old one from potato, replace it with new version.
# This fixes an old upgrade bug.
if [ -e /var/lib/sysnews/WELCOME ] &&
   [ "`md5sum /var/lib/sysnews/WELCOME | cut -d ' ' -f 1`" =  "2733bd0ca400d3131f220a5b2f7250c1" ]; then
   	install -m 0644 --preserve-timestamps /usr/share/sysnews/WELCOME \
	                                      /var/lib/sysnews/WELCOME
fi