diff options
Diffstat (limited to 'debian/python3-vmmsclient.postinst')
| -rw-r--r-- | debian/python3-vmmsclient.postinst | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/debian/python3-vmmsclient.postinst b/debian/python3-vmmsclient.postinst new file mode 100644 index 0000000..16d884f --- /dev/null +++ b/debian/python3-vmmsclient.postinst @@ -0,0 +1,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 |
