This file is indexed.

postinst is in libapache2-mod-wsgi 3.3-4build1.

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
#!/bin/sh

set -e

apache_force_reload() {
    if apache2ctl configtest 2>/dev/null; then
        #invoke-rc.d apache2 force-reload || true
        # use "restart" as a workaround for bug #558608
        invoke-rc.d apache2 restart || true
    else
        echo "Your apache2 configuration is broken, please fix it and restart apache2 manually."
    fi
}

update_symlink() {
    wsgi_py=`readlink /usr/lib/apache2/modules/mod_wsgi.so | sed 's,.*-,,'`
    py_default=`dpkg -s python | grep '^Version' | sed 's,Version: \([^.]*.[^.]*\).*,\1,'`
    if [ ! "${wsgi_py}" = "${py_default}" ]; then
        ln -sf mod_wsgi.so-${py_default} /usr/lib/apache2/modules/mod_wsgi.so
    fi
}

if [ -z "$2" ]; then
    update_symlink
    if [ -e /etc/apache2/apache2.conf ]; then
        a2enmod wsgi >/dev/null || true
        apache_force_reload
    fi
else
    #we're upgrading
    update_symlink
    if [ -e /etc/apache2/mods-enabled/wsgi.load ]; then
        apache_force_reload
    fi
fi



exit 0