Debian packaging: properly handle /etc/evcc-userchoices.sh lifecycle (#27989)
This commit is contained in:
parent
6e12bd9d59
commit
cc4beb0b99
4 changed files with 13 additions and 0 deletions
|
|
@ -85,6 +85,7 @@ nfpms:
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
- adduser
|
- adduser
|
||||||
|
- ucf
|
||||||
|
|
||||||
contents:
|
contents:
|
||||||
- src: ./packaging/init/evcc.service
|
- src: ./packaging/init/evcc.service
|
||||||
|
|
|
||||||
|
|
@ -105,6 +105,7 @@ nfpms:
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
- adduser
|
- adduser
|
||||||
|
- ucf
|
||||||
|
|
||||||
contents:
|
contents:
|
||||||
- src: ./packaging/init/evcc.service
|
- src: ./packaging/init/evcc.service
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,11 @@ KEEP_ETC_SERVICE=$KEEP_ETC_SERVICE
|
||||||
KEEP_USR_LOCAL_BIN=$KEEP_USR_LOCAL_BIN
|
KEEP_USR_LOCAL_BIN=$KEEP_USR_LOCAL_BIN
|
||||||
EOF
|
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
|
# Execute the user decision
|
||||||
if [ -f "$ETC_SERVICE" ] && [ "$KEEP_ETC_SERVICE" -eq 0 ]; then
|
if [ -f "$ETC_SERVICE" ] && [ "$KEEP_ETC_SERVICE" -eq 0 ]; then
|
||||||
echo "Deleting old service file '$ETC_SERVICE'"
|
echo "Deleting old service file '$ETC_SERVICE'"
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,12 @@ if [ "$1" = "purge" ]; then
|
||||||
deb-systemd-helper purge evcc.service > /dev/null || true
|
deb-systemd-helper purge evcc.service > /dev/null || true
|
||||||
deb-systemd-helper unmask evcc.service > /dev/null || true
|
deb-systemd-helper unmask evcc.service > /dev/null || true
|
||||||
fi
|
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
|
fi
|
||||||
|
|
||||||
# if interactive: call `/usr/bin/evcc checkconfig` and check the return code (newer version)
|
# if interactive: call `/usr/bin/evcc checkconfig` and check the return code (newer version)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue