From 4f75bda942a9819b60baf192d9c0cd16675f2b57 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Wed, 10 Jun 2020 10:42:13 +0300 Subject: [PATCH] kiss: Simplify pkg_remove_files() --- kiss | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/kiss b/kiss index b73b461..65d040d 100755 --- a/kiss +++ b/kiss @@ -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.