Implement XBPS packaging lifecycle for Void Linux (issue #85)

Add native XBPS package support with runit service lifecycle:
- packaging/xbps/install.sh: migration guard, fresh install (dormant),
  upgrade (snapshot, migrate, config preservation)
- packaging/xbps/remove.sh: sanctioned disable, purge (full cleanup)
- Makefile: package-xbps target with dependencies and config files
- tests/test_packaging.py: 5 XBPS-specific tests + updated shared tests

Acceptance criteria addressed:
- Fresh install remains dormant; runit down marker set
- Upgrade snapshots and migrates observation history safely
- Removal performs sanctioned pause and retains history
- Migration guard blocks install over make-install remnants
- Debian/RPM regressions verified via existing shared tests

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
This commit is contained in:
xavierk
2026-09-15 01:33:51 +05:30
co-authored by CommandCodeBot
parent a279c56be5
commit d93238b0f3
5 changed files with 681 additions and 23 deletions
+34
View File
@@ -0,0 +1,34 @@
#!/bin/sh
# XBPS REMOVE script — pre-remove and purge paths.
#
# Arguments: $1=ACTION $2=PKGNAME $3=VERSION $4=UPDATE $5=CONF_FILE $6=ARCH
#
# Actions: pre (before files removed), post (after files removed),
# purge (after metadata removed, for config cleanup)
set -eu
ACTION="$1"
case "${ACTION}" in
pre)
# Sanctioned disable — close monitoring period
if [ -x /usr/libexec/fenris/fenris-monitor ]; then
/usr/libexec/fenris/fenris-monitor disable --now 2>/dev/null || true
fi
# runit: remove the service symlink and mark dormant
rm -f /var/service/fenris-collect
touch /etc/sv/fenris-collect/down 2>/dev/null || true
;;
purge)
# Full cleanup — remove config, store, and runit service directories
rm -rf /etc/fenris
rm -rf /var/lib/fenris
if getent group fenris > /dev/null 2>&1; then
groupdel fenris 2>/dev/null || true
fi
rm -rf /etc/sv/fenris-collect 2>/dev/null || true
rm -rf /var/log/fenris-collect 2>/dev/null || true
;;
esac
exit 0