zapretgui/packaging/linux/deb/prerm
loop-uh ca0bd7a9f3
All checks were successful
Zapret source guards / validate (push) Successful in 9s
Linux bundle: UTF-8 restart, helper role in the same program, .deb scripts and start wrappers
First Nuitka build of the program on Linux showed that the compiled program does not turn the "C" locale into UTF-8: Russian preset file names became lone surrogates and the first-run seeding of the data folder failed. New `Launch.prepare_process()` (no-op on Windows and in the stub) restarts the Linux program once in UTF-8 mode; the start wrappers also set PYTHONUTF8=1.

`src/main.py --zapret-helper` runs the same compiled file in the helper role (what zapretgui-helper.service starts). New: packaging/linux/bin/{zapretgui,zapretgui-helper}, packaging/linux/deb/{control.in,postinst,prerm,postrm}, tests for the wrappers, the dispatch and the .deb files.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 15:46:20 -05:00

11 lines
460 B
Shell

#!/bin/sh
set -e
if [ "$1" = remove ] || [ "$1" = upgrade ] || [ "$1" = deconfigure ]; then
if [ -d /run/systemd/system ]; then
systemctl stop zapretgui-helper.service || true
[ "$1" = remove ] && systemctl disable zapretgui-helper.service || true
fi
# the helper removes its table when it stops; this is the second net, so no rule outlives the program
command -v nft >/dev/null && nft delete table inet zapretgui 2>/dev/null || true
fi
exit 0