archey4/packaging/before_remove
Samuel FORESTIER d4a6b16823
[PACKAGING] Provides a dedicated AppArmor profile (#119)
Co-authored-by: Alexandre Pujol <alexandre@pujol.io>
Co-authored-by: Michael Bromilow <developer@bromilow.uk>
2024-04-13 17:20:48 +00:00

25 lines
550 B
Bash

#!/bin/sh
set -e
# Removes symbolic link created by `after_install`.
if [ -L /usr/bin/archey4 ]; then
rm /usr/bin/archey4
fi
# Removes any byte-code file that may have been generated by Archey.
# Wild-cards are being used to match all supported distribution layouts.
find /usr/lib/python3*/*-packages/archey \
-type d \
-name __pycache__ \
-exec \
rm -r {} +
# Removes the AppArmor definition from kernel.
APP_PROFILE="/etc/apparmor.d/usr.bin.archey4"
if aa-enabled --quiet 2>/dev/null; then
apparmor_parser -R "$APP_PROFILE" || true
fi