~ubuntu-branches/ubuntu/saucy/clamav/saucy-backports

« back to all changes in this revision

Viewing changes to debian/clamav-freshclam.preinst

  • Committer: Package Import Robot
  • Author(s): Scott Kitterman
  • Date: 2014-07-15 01:08:10 UTC
  • mfrom: (0.35.47 sid)
  • Revision ID: package-import@ubuntu.com-20140715010810-ru66ek4fun2iseba
Tags: 0.98.4+dfsg-2~ubuntu13.10.1
No-change backport to saucy (LP: #1341962)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh
2
 
# preinst script for #PACKAGE#
3
 
#
4
 
 
5
 
set -e
6
 
 
7
 
APP_PROFILE="usr.bin.freshclam"
8
 
APP_CONFFILE="/etc/apparmor.d/$APP_PROFILE"
9
 
APP_COMPLAIN="/etc/apparmor.d/force-complain/$APP_PROFILE"
10
 
if [ "$1" = "upgrade" ]; then
11
 
    mkdir -p `dirname $APP_COMPLAIN` 2>/dev/null || true
12
 
    if dpkg --compare-versions $2 lt 0.92.1~dfsg2-1.1~feisty3 ; then
13
 
        # force-complain for pre-apparmor upgrades
14
 
        ln -sf $APP_CONFFILE $APP_COMPLAIN
15
 
    elif dpkg --compare-versions $2 lt 0.93.3.dfsg-1ubuntu1 ; then
16
 
        if [ -e "$APP_CONFFILE" ]; then
17
 
            md5sum="`md5sum \"$APP_CONFFILE\" | sed -e \"s/ .*//\"`"
18
 
            pkg_md5sum="`sed -n -e \"/^Conffiles:/,/^[^ ]/{\\\\' $APP_CONFFILE'{s/.* //;p}}\" /var/lib/dpkg/status`"
19
 
            if [ "$md5sum" = "$pkg_md5sum" ]; then
20
 
                # force-complain on upgrade from pre-shipped profile and
21
 
                # existing profile is same as in conffiles
22
 
                ln -sf $APP_CONFFILE $APP_COMPLAIN
23
 
            fi
24
 
        else
25
 
            # force-complain on upgrade from pre-shipped profile and
26
 
            # there is no existing profile
27
 
            ln -sf $APP_CONFFILE $APP_COMPLAIN
28
 
        fi
29
 
    fi
30
 
fi
31
 
 
32
 
#DEBHELPER#
33
 
 
34
 
exit 0
35