blob: 16d884f36152a0b4355da97fc749b34076fd1747 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#!/bin/bash
set -e
if [ "$1" = "configure" ] || [ "$1" = "upgrade" ]; then
# Clear Python bytecode cache
find /usr/lib/python3/dist-packages/vmmsclient -name "*.pyc" -delete 2>/dev/null || true
find /usr/lib/python3/dist-packages/vmmsclient -name "__pycache__" -type d -exec rm -rf {} + 2>/dev/null || true
# Force Python to regenerate entry point cache
python3 -c "import importlib; import sys;
[sys.modules.pop(key) for key in list(sys.modules.keys()) if key.startswith('vmmsclient')];" 2>/dev/null || true
fi
#DEBHELPER#
exit 0
|