This file is indexed.

postrm is in pluxml 5.5-2.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
#!/bin/sh
set -e

# summary of how this script can be called:
#        * <postrm> `remove'
#        * <postrm> `purge'
#        * <old-postrm> `upgrade' <new-version>
#        * <new-postrm> `failed-upgrade' <old-version>
#        * <new-postrm> `abort-install'
#        * <new-postrm> `abort-install' <old-version>
#        * <new-postrm> `abort-upgrade' <old-version>
#        * <disappearer's-postrm> `disappear' <overwriter>
#          <overwriter-version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package


# Disable apache2 configuration
disable_apache2_conf()
{
    if [ -e /usr/share/apache2/apache2-maintscript-helper ]
    then
        . /usr/share/apache2/apache2-maintscript-helper
        apache2_invoke disconf pluxml
    fi
    rm -f /etc/apache2/conf-available/pluxml.conf
}


# Reload apache2
reload_apache2()
{
    # Nothing, since `apache2_invoke disconf` already did what had to be done
    :
}


# Disable lighttpd configuration
disable_lighttpd_conf()
{
    if command -v lighty-disable-mod >/dev/null 2>/dev/null
    then
        lighty-disable-mod pluxml || true
    fi
    rm -f /etc/lighttpd/conf-available/50-pluxml.conf
}


# Reload lighttpd
reload_lighttpd()
{
    # That may fail if lighttpd is not running: this is not a real problem, so
    # ignore it
    invoke-rc.d lighttpd reload || true
}


# Unregister and remove files managed by ucf, and all their avatars
remove_ucffiles()
{
    if command -v ucf >/dev/null 2>/dev/null
    then
        for file in "$@"
        do
            ucf --purge "$file"
        done
    fi
    if command -v ucfr >/dev/null 2>/dev/null
    then
        for file in "$@"
        do
            ucfr --purge pluxml "$file"
        done
    fi
    for ext in '' '~' '%' .bak .ucf-new .ucf-old .ucf-dist
    do
        for file in "$@"
        do
            rm -f "$file$ext"
        done
    done
}


case "$1" in
    purge)
        # Remove special permissions overrides
        if dpkg-statoverride --list /etc/pluxml >/dev/null 2>&1
        then
            dpkg-statoverride --remove /etc/pluxml
        fi
        if dpkg-statoverride --list /etc/pluxml/plugins >/dev/null 2>&1
        then
            dpkg-statoverride --remove /etc/pluxml/plugins
        fi

        # Remove dynamic configuration files managed by ucf
        remove_ucffiles /etc/pluxml/apache2.conf /etc/pluxml/lighttpd.conf \
                        /etc/pluxml/parametres.xml /etc/pluxml/adminkey \
                        /etc/pluxml/users.xml

        if [ -e /usr/share/debconf/confmodule ]
        then
            . /usr/share/debconf/confmodule
            # Purge blog data if chosen by the user during the installation
            db_get pluxml/system/purgedata
            if [ "$RET" = "true" ]
            then
                # Removing blog text
                rm -f /var/lib/pluxml/data/articles/*
                rm -f /var/lib/pluxml/data/statiques/*
                rm -f /var/lib/pluxml/data/commentaires/*
                # Removing media
                rm -rf /var/lib/pluxml/data/documents/*
                rm -rf /var/lib/pluxml/data/documents/.thumbs
                rm -rf /var/lib/pluxml/data/images/*
                rm -rf /var/lib/pluxml/data/images/.thumbs
                # Removing pseudo-configuration
                rm -f /var/lib/pluxml/data/configuration/plugins.xml \
                      /var/lib/pluxml/data/configuration/categories.xml \
                      /var/lib/pluxml/data/configuration/statiques.xml \
                      /var/lib/pluxml/data/configuration/tags.xml
            fi
        fi
    ;;

    remove|disappear)
        if [ -e /usr/share/debconf/confmodule ]
        then
            . /usr/share/debconf/confmodule
            # Remove the configuration from the chosen webservers (it makes no
            # sense to keep webservers configured for a blog that has been
            # removed)
            db_get pluxml/system/webservers
            for webserver in $RET
            do
                webserver=${webserver%,}
                disable_${webserver}_conf "$@"
                if [ "$reload_webserver" = "true" ]
                then
                    reload_$webserver "$@"
                fi
            done
        fi
    ;;

    upgrade|failed-upgrade|abort-install|abort-upgrade)
    ;;

    *)
        echo "postrm called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

# Automatically added by dh_installdebconf
if [ "$1" = purge ] && [ -e /usr/share/debconf/confmodule ]; then
	. /usr/share/debconf/confmodule
	db_purge
fi
# End automatically added section


# Stop debconf, or the script would stall forever if we restarted lighttpd
# (cf. debconf-devel(7) (search for “daemon”) and bug #133029)
if [ "$1" = "purge" ]
then
    if [ -e /usr/share/debconf/confmodule ]
    then
        db_stop
    fi
fi

exit 0