aboutsummaryrefslogtreecommitdiffstats
path: root/packaging/deb/meshbay-cli/DEBIAN/postinst
blob: e09d713ee218ca97a7e5e6a2fa02fa523362c0f2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh
set -e

# The client runs as an unprivileged user, who cannot write bytecode into
# /opt: compiled here once, or every run compiles Textual again in memory.
case "$1" in
    configure)
        if command -v py3compile >/dev/null 2>&1; then
            site=$(echo /opt/meshbay-common/venv/lib/python3.*/site-packages)
            while IFS= read -r entry; do
                [ -d "$site/$entry" ] && py3compile "$site/$entry" 2>/dev/null || true
            done < /opt/meshbay-cli/site-packages.list
        fi
        ;;
esac

#DEBHELPER#