Debian packaging: properly handle /etc/evcc-userchoices.sh lifecycle (#27989)

This commit is contained in:
Copilot 2026-03-08 12:34:20 +01:00 • committed by GitHub
parent 6e12bd9d59
commit cc4beb0b99
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 13 additions and 0 deletions

View file

@ -58,6 +58,11 @@ KEEP_ETC_SERVICE=$KEEP_ETC_SERVICE
KEEP_USR_LOCAL_BIN=$KEEP_USR_LOCAL_BIN
EOF
# Register file with ucfr so it is tracked as belonging to the evcc package
if [ -x /usr/bin/ucfr ]; then
ucfr evcc "$USER_CHOICE_CONFIG"
fi
# Execute the user decision
if [ -f "$ETC_SERVICE" ] && [ "$KEEP_ETC_SERVICE" -eq 0 ]; then
echo "Deleting old service file '$ETC_SERVICE'"

View file

@ -16,6 +16,12 @@ if [ "$1" = "purge" ]; then
deb-systemd-helper purge evcc.service > /dev/null || true
deb-systemd-helper unmask evcc.service > /dev/null || true
fi
# Remove the user choices config file and deregister it from ucfr
if [ -x /usr/bin/ucfr ]; then
ucfr --purge evcc /etc/evcc-userchoices.sh || true
fi
rm -f /etc/evcc-userchoices.sh
fi
# if interactive: call `/usr/bin/evcc checkconfig` and check the return code (newer version)