From 03f560bb4aaeda0e06c95684c187a394593c88e3 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Thu, 1 Oct 2026 16:58:47 +0200 Subject: fix(packaging): meshbay-common clears its compiled bytecode before an upgrade The postinst compiles __pycache__ directories the package does not own; on the next upgrade they kept dpkg from removing directories the new version no longer ships, and it warned. preinst/prerm (deb) and %pre/%preun (rpm) remove them first. Co-Authored-By: Claude Opus 5.5 --- packaging/deb/meshbay-common/DEBIAN/prerm | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 packaging/deb/meshbay-common/DEBIAN/prerm (limited to 'packaging/deb/meshbay-common/DEBIAN/prerm') diff --git a/packaging/deb/meshbay-common/DEBIAN/prerm b/packaging/deb/meshbay-common/DEBIAN/prerm new file mode 100755 index 0000000..e7b665b --- /dev/null +++ b/packaging/deb/meshbay-common/DEBIAN/prerm @@ -0,0 +1,13 @@ +#!/bin/sh +set -e + +# Bytecode the postinst compiled is not the package's: removed here, so that +# dpkg can remove the directories it was written into. +case "$1" in + remove|upgrade|deconfigure) + find /opt/meshbay-common/venv -depth -type d -name __pycache__ \ + -exec rm -rf {} + 2>/dev/null || true + ;; +esac + +#DEBHELPER# -- cgit v1.2.3