This file is indexed.

postinst is in python3-mailman-hyperkitty 1.1.0-4.

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

set -e

. /usr/share/debconf/confmodule

django_admin="python2.7 /usr/bin/django-admin"
django_admin_args="--verbosity 0 --no-color --pythonpath /usr/share/mailman3-web --settings settings"

hyperkitty_cfg_new=

cleanup () {
    [ "$hyperkitty_cfg_new" ] && rm -f "$hyperkitty_cfg_new"
}

create_config () {
    trap cleanup EXIT

    hyperkitty_cfg_new=`tempfile -m 0644`
    cp -a /usr/share/python3-mailman-hyperkitty/mailman-hyperkitty.cfg \
            $hyperkitty_cfg_new

    # Get MAILMAN_ARCHIVER_KEY from mailman3-web django project
    if [ -f /usr/share/mailman3-web/manage.py ] && [ -f /usr/bin/django-admin ]; then
        archiverkey="$(su --shell /bin/sh --command \
                "$django_admin print_settings $django_admin_args" www-data | \
                sed -n -e "s/^MAILMAN_ARCHIVER_KEY\s*=\s*'\(\S\+\)'\s*$/\1/p")"
    fi

    if [ -n "$archiverkey" ]; then
        # Set archiver api key in mailman-hyperkitty.cfg
        sed -i -e "s|\(api_key:\s*\)\S\+\(\s*\)$|\1$archiverkey\2|" \
                $hyperkitty_cfg_new
    else
        db_input high python3-mailman-hyperkitty/no_archiverkey || true
        db_go
    fi

    # Register new config file
    ucf --three-way --debconf-ok "$hyperkitty_cfg_new" /etc/mailman3/mailman-hyperkitty.cfg
    ucfr python3-mailman-hyperkitty /etc/mailman3/mailman-hyperkitty.cfg
    chmod 0640 /etc/mailman3/mailman-hyperkitty.cfg
    chown root:list /etc/mailman3/mailman-hyperkitty.cfg
    rm -f $hyperkitty_cfg_new
}

case "$1" in
    configure)
        create_config

        db_stop
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
    ;;

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


# Automatically added by dh_python3:
if which py3compile >/dev/null 2>&1; then
	py3compile -p python3-mailman-hyperkitty -V 3.5-
fi

# End automatically added section


exit 0