kiss: Fix removal bug. Closes #131

This commit is contained in:
Dylan Araps 2020-04-14 14:48:36 +00:00
parent 2f545dda68
commit 12f717265c
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E

9
kiss
View File

@ -881,10 +881,11 @@ pkg_remove() {
# manager from removing user edited configuration files.
[ "${file##/etc/*}" ] || continue
# Lazy removal. Try remove as a directory first before
# falling back to a file removal. Removes all files and
# only directories if empty.
rmdir "$KISS_ROOT/$file" || rm -f "$KISS_ROOT/$file" ||:
if [ -d "$KISS_ROOT/$file" ]; then
rmdir "$KISS_ROOT/$file" 2>/dev/null || continue
else
rm -f "$KISS_ROOT/$file"
fi
done < "$sys_db/$1/manifest" 2>/dev/null
# Reset 'trap' to its original value. Removal is done so