From 13b9b9c3136a2d4859f6da799950e28d688e7dd0 Mon Sep 17 00:00:00 2001 From: Christophe Besson Date: Sat, 3 Oct 2026 15:06:44 +0200 Subject: fix(packaging): node and hub stop and clear their bytecode on removal A node left running after removal recompiled bytecode into the shared venv, and meshbay-common's cleanup ran too late for the node and hub directories: dpkg warned that they were not empty. Co-Authored-By: Claude Opus 5.5 --- packaging/rpm/meshbay-hub.spec | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'packaging/rpm/meshbay-hub.spec') diff --git a/packaging/rpm/meshbay-hub.spec b/packaging/rpm/meshbay-hub.spec index 90a4f08..ffd991a 100644 --- a/packaging/rpm/meshbay-hub.spec +++ b/packaging/rpm/meshbay-hub.spec @@ -40,6 +40,12 @@ install -d -o root -g meshbay -m 750 /etc/meshbay %preun %systemd_preun meshbay-hub.service +# The hub's code lives in meshbay-common's venv, whose own cleanup runs only +# after this package is gone: the bytecode compiled next to it is removed here. +if [ "$1" -eq 0 ]; then + find /opt/meshbay-common/venv/lib/python3.*/site-packages/meshbay_hub \ + -depth -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true +fi %postun %systemd_postun_with_restart meshbay-hub.service -- cgit v1.2.3