From 67de5552e2761a8d7f61e74a668893afcaf338b6 Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Thu, 25 Dec 2025 03:54:07 -0500 Subject: [PATCH] fix: fix remove --- leaf | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/leaf b/leaf index 5b6fbfb..42c6fb4 100755 --- a/leaf +++ b/leaf @@ -55,7 +55,7 @@ main() { fi leaf_reset_state if [[ x"$1" == x"remove" ]]; then - source "${TRACE_DIR}/${PKG_PREFIX}/${PKG_NAME}/PKGBUILD" + source "${TRACE_DIR}/${PKG_PREFIX}/${PKG_NAME}/PKGBUILD" || leaf_record_message "cannot find PKGBUILD, ingore." else source "${PKGBUILD_DIR}/${PKG_PREFIX}/${PKG_NAME}".PKGBUILD fi @@ -546,7 +546,9 @@ leaf_remove_package() { [ ! -L "${_link}" ] || rm -fv "${_link}" done cat "${TRACE_DIR}/${PKG_PREFIX}/${PKG_NAME}/DIRS" | while read -r _directory; do - rmdir --ignore-fail-on-non-empty "${_directory}" + if [[ -d _directory ]]; then + rmdir --ignore-fail-on-non-empty "${_directory}" + fi done src_postremove leaf_invoke_hooks remove