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
190
# force-complain on upgrade from pre-shipped profile and
191
# there is no existing profile
192
ln -sf $APP_CONFFILE $APP_COMPLAIN