File: preinst

package info (click to toggle)
portmap 6.0.0-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 320 kB
  • ctags: 87
  • sloc: ansic: 1,065; sh: 194; makefile: 96
file content (21 lines) | stat: -rw-r--r-- 547 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#! /bin/sh
set -e

action=$1
version=$2
CONFFILE=/etc/default/portmap

# TBD: should be based on a given version
if [ "$action" = "upgrade" ] && [ -e /etc/portmap.conf ] \
   && dpkg --compare-versions "$version" gt 5-10 \
   && dpkg --compare-versions "$version" lt 5-13 ; then
	# get rid of /etc/portmap.conf if it did not change from the default?
	# Move to the "new" conffile location, let the user handle
	# the change (if needed)
		[ -e $CONFFILE ] && mv $CONFFILE $CONFFILE.dpkg-old
		mv /etc/portmap.conf $CONFFILE
fi

#DEBHELPER#

exit 0