kiss: Added support for pre-remove scripts. Closes #64

This commit is contained in:
Dylan Araps 2020-02-04 13:07:33 +02:00
parent d1c809b28d
commit a59f1dad60
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
1 changed files with 5 additions and 0 deletions

5
kiss
View File

@ -821,6 +821,11 @@ pkg_remove() {
# an incomplete package installed.
trap '' INT
if [ -x "$sys_db/$1/pre-remove" ]; then
log "$1" "Running pre-remove script"
"$sys_db/$1/pre-remove" ||:
fi
while read -r file; do
# The file is in '/etc' skip it. This prevents the package
# manager from removing user edited configuration files.