Tag: patch
thanks
This happens when the directory to delete files under is empty.
This patch tests if the directory is not empty to run find --delete
--- a/usr/sbin/localepurge
+++ b/usr/sbin/localepurge
@@ -216,7 +216,10 @@ function remove_superfluous_files_under ()
if [[ "$1" == $superfluouslocalepat ]]; then shift
local flag
((VERBOSE)) && flag=-print
- find "$@" -mindepth 1 \( -type f -o -type l \) $flag -delete
+ # ensure directory is not empty to avoid find to exit with error
+ if [ -n "$(ls -A "$@")" ]; then
+ find "$@" -mindepth 1 \( -type f -o -type l \) $flag -delete
+ fi
fi
}
--
Best regards / Melhores cumprimentos,
Miguel Figueiredo