From 48917868a70b657f87138a4af8f092c4fb2b0528 Mon Sep 17 00:00:00 2001 From: "Tomas Kelemen (vudiq)" Date: Tue, 23 Jul 2019 17:07:16 +0200 Subject: [PATCH] safe_remove: remove also broken symbolic links if the target ($1) is a symbolic link to a removed file/folder, the check will fail and the (broken) symbolic link will be not removed. --- config/functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/functions b/config/functions index 419e3c5358..3da1b4dbd4 100644 --- a/config/functions +++ b/config/functions @@ -136,7 +136,7 @@ safe_remove() { [ -z "${path}" ] && return 0 - if [ -f "${path}" -o -d "${path}" ]; then + if [ -e "${path}" -o -L "${path}" ]; then rm -r "${path}" elif [ -n "${PKG_NAME}" ]; then print_color CLR_WARNING "safe_remove: path does not exist: [${PKG_NAME}]: ${path}\n"