source: trunk/third/moira/debian/debathena-moira-update-server.preinst @ 24255

Revision 24255, 1.2 KB checked in by broder, 14 years ago (diff)
Assorted cleanup in moira: - Squelch some bashisms in the update-server {pre,post}insts - Remove files no longer in the SVN repository - Fix the clean target to remove a modified libtool file.
  • Property svn:executable set to *
Line 
1#!/bin/sh
2# preinst script for debathena-moira-update-server
3#
4# see: dh_installdeb(1)
5
6set -e
7
8# summary of how this script can be called:
9#        * <new-preinst> `install'
10#        * <new-preinst> `install' <old-version>
11#        * <new-preinst> `upgrade' <old-version>
12#        * <old-preinst> `abort-upgrade' <new-version>
13# for details, see http://www.debian.org/doc/debian-policy/ or
14# the debian-policy package
15
16# Prepare to move a conffile without triggering a dpkg question
17prep_mv_conffile() {
18    PKGNAME="$1"
19    CONFFILE="$2"
20
21    [ -e "$CONFFILE" ] || return 0
22
23    md5sum="$(md5sum $CONFFILE | sed -e 's/ .*//')"
24    old_md5sum="$(dpkg-query -W -f='${Conffiles}' $PKGNAME | sed -n -e "\' $CONFFILE ' { s/ obsolete$//; s/.* //; p }")"
25    if [ "$md5sum" = "$old_md5sum" ]; then
26        rm -f "$CONFFILE"
27    fi
28}
29
30case "$1" in
31    install|upgrade)
32        if dpkg --compare-versions "$2" lt 4.0.0+svn20100104-0debathena1~; then
33            prep_mv_conffile debathena-moira-update-server /etc/athena/moira.conf
34        fi
35    ;;
36
37    abort-upgrade)
38    ;;
39
40    *)
41        echo "preinst called with unknown argument \`$1'" >&2
42        exit 1
43    ;;
44esac
45
46# dh_installdeb will replace this with shell code automatically
47# generated by other debhelper scripts.
48
49#DEBHELPER#
50
51exit 0
52
53
Note: See TracBrowser for help on using the repository browser.