kiss: Simplify pkg_remove_files()

This commit is contained in:
Dylan Araps 2020-06-10 10:42:13 +03:00
parent 04730c9be6
commit 4f75bda942
No known key found for this signature in database
GPG Key ID: 46D62DD9F1DE636E
1 changed files with 4 additions and 6 deletions

10
kiss
View File

@ -956,14 +956,12 @@ pkg_remove_files() {
# Remove a file list from the system. This function runs during package
# installation and package removal. Combining the removals in these two
# functions allows us to stop duplicating code.
while read -r file; do
# Skip deleting some leftover files.
case $file in /etc/*) continue; esac
file=$KISS_ROOT/$file
while read -r file; do file=$KISS_ROOT/$file
# Skip files in /etc/.
if [ -z "${file##"$KISS_ROOT/etc/"*}" ]; then :
# Remove files.
if [ -f "$file" ] && [ ! -h "$file" ]; then
elif [ -f "$file" ] && [ ! -h "$file" ]; then
rm -f "$file"
# Remove file symlinks.