Merge pull request #19466 from Homebrew/rmdir-ignore-permission-errors

rmdir: ignore unreadable path errors
This commit is contained in:
Mike McQuaid 2025-03-11 14:46:33 +00:00 committed by GitHub
commit b35b9eb1a8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -26,7 +26,7 @@ do
# Some packages leave broken symlinks around; we clean them out before
# attempting to `rmdir` to prevent extra cruft from accumulating.
/usr/bin/find -f "${path}" -- -mindepth 1 -maxdepth 1 -type l ! -exec /bin/test -e {} \; -delete
/usr/bin/find -f "${path}" -- -mindepth 1 -maxdepth 1 -type l ! -exec /bin/test -e {} \; -delete || true
elif ! ${symlink} && [[ ! -e "${path}" ]]
then
# Skip paths that don't exists and aren't a broken symlink.