~ubuntu-branches/ubuntu/hardy/mysql-dfsg-5.0/hardy-updates

« back to all changes in this revision

Viewing changes to debian/mysql-server-5.0.preinst

  • Committer: Bazaar Package Importer
  • Author(s): Mathias Gug, Nicolas Valcárcel, Jamie Strandboge
  • Date: 2008-03-25 17:05:22 UTC
  • Revision ID: james.westby@ubuntu.com-20080325170522-yu0m3zcfs43gs0eo
Tags: 5.0.51a-3ubuntu3
[ Nicolas Valcárcel ]
* Confirming password on install if given (LP: #162167)

[ Jamie Strandboge ]
* follow ApparmorProfileMigration and force apparmor complain mode on some
  upgrades (LP: #203531)
  - debian/control: Recommends apparmor >= 2.1+1075-0ubuntu6
  - debian/mysql-server-5.0.dirs: add etc/apparmor.d/force-complain
  - debian/mysql-server-5.0.preinst: create symlink for force-complain/
    on pre-feisty upgrades, upgrades where apparmor-profiles profile is
    unchanged (ie non-enforcing) and upgrades where the profile doesn't
    exist
  - debian/mysql-server-5.0.postrm: remove symlink in force-complain/ on
    purge
* debian/additions/my.cnf: add warning about apparmor (LP: #201799)

Show diffs side-by-side

added added

removed removed

Lines of Context:
169
169
 
170
170
db_stop
171
171
 
 
172
APP_PROFILE="usr.sbin.mysqld"
 
173
APP_CONFFILE="/etc/apparmor.d/$APP_PROFILE"
 
174
APP_COMPLAIN="/etc/apparmor.d/force-complain/$APP_PROFILE"
 
175
if [ "$1" = "upgrade" ]; then
 
176
    mkdir -p `dirname $APP_COMPLAIN` 2>/dev/null || true
 
177
    if dpkg --compare-versions $2 lt 5.0.38-0ubuntu1 ; then
 
178
        # force-complain for pre-apparmor upgrades
 
179
        ln -sf $APP_CONFFILE $APP_COMPLAIN
 
180
    elif dpkg --compare-versions $2 lt 5.0.51a-1ubuntu1 ; then
 
181
        if [ -e "$APP_CONFFILE" ]; then
 
182
            md5sum="`md5sum \"$APP_CONFFILE\" | sed -e \"s/ .*//\"`"
 
183
            pkg_md5sum="`sed -n -e \"/^Conffiles:/,/^[^ ]/{\\\\' $APP_CONFFILE'{s/.* //;p}}\" /var/lib/dpkg/status`"
 
184
            if [ "$md5sum" = "$pkg_md5sum" ]; then
 
185
                # force-complain on upgrade from pre-shipped profile and
 
186
                # existing profile is same as in conffiles
 
187
                ln -sf $APP_CONFFILE $APP_COMPLAIN
 
188
            fi
 
189
        else
 
190
            # force-complain on upgrade from pre-shipped profile and
 
191
            # there is no existing profile
 
192
            ln -sf $APP_CONFFILE $APP_COMPLAIN
 
193
        fi
 
194
    fi
 
195
fi
 
196
 
 
197
 
172
198
#DEBHELPER#
173
199
 
174
200
exit 0