~maria-captains/maria/10.0

« back to all changes in this revision

Viewing changes to storage/mroonga/packages/debian/mysql-server-mroonga.postrm

  • Committer: Sergei Golubchik
  • Date: 2014-11-18 21:27:03 UTC
  • mto: This revision was merged to the branch mainline in revision 4505.
  • Revision ID: sergii@pisem.net-20141118212703-53r5ykbkbbr3t25p
mroonga/groonga: remove unused packaging data and bundled software

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh
2
 
 
3
 
set -e
4
 
 
5
 
if [ "$1" = "purge" ]; then
6
 
    mysql_apparmor_profile_name=usr.sbin.mysqld
7
 
    mysql_apparmor_profile=/etc/apparmor.d/${mysql_apparmor_profile_name}
8
 
    mysql_local_apparmor_profile=/etc/apparmor.d/local/${mysql_apparmor_profile_name}
9
 
    mysql_abstraction_apparmor_profile=/etc/apparmor.d/abstractions/mysql
10
 
    apparmor_profile_name=mysql-server-mroonga
11
 
    if test -f "${mysql_local_apparmor_profile}"; then
12
 
        include_profile="#include <abstractions/${apparmor_profile_name}>"
13
 
        if grep -q "${include_profile}" "${mysql_local_apparmor_profile}"; then
14
 
            sed -i'' -e "s,${include_profile},," \
15
 
                "${mysql_local_apparmor_profile}"
16
 
        fi
17
 
    else
18
 
        start_marker_re="^# ${apparmor_profile_name}: START$"
19
 
        end_marker_re="^# ${apparmor_profile_name}: END$"
20
 
        if test -f "${mysql_abstraction_apparmor_profile}" && \
21
 
            grep -q "${start_marker_re}" \
22
 
              "${mysql_abstraction_apparmor_profile}"; then
23
 
            sed -i'' -e "/${start_marker_re}/,/${end_marker_re}/d" \
24
 
                "${mysql_abstraction_apparmor_profile}"
25
 
        fi
26
 
    fi
27
 
 
28
 
    rm -f "/etc/apparmor.d/local/${apparmor_profile_name}" || true
29
 
    rmdir /etc/apparmor.d/local 2>/dev/null || true
30
 
 
31
 
    if aa-status --enabled 2>/dev/null; then
32
 
        apparmor_parser -r -T -W "${mysql_apparmor_profile}" || true
33
 
    fi
34
 
fi
35
 
 
36
 
#DEBHELPER#
37
 
 
38
 
exit 0