Hack around busybox find / rm not handling -- correctly.

This commit is contained in:
Roy Marples 2008-01-25 12:33:53 +00:00
parent 8793fb8d4c
commit 829f4d281c

View File

@ -18,11 +18,16 @@ cleanup_tmp_dir()
cd "${dir}" cd "${dir}"
if yesno ${wipe_tmp:-${WIPE_TMP:-yes}}; then if yesno ${wipe_tmp:-${WIPE_TMP:-yes}}; then
ebegin "Wiping ${dir} directory" ebegin "Wiping ${dir} directory"
local startopts="-x . -depth" local startopts="-x . -depth" delete="-exec rm -rf -- {} ;"
[ "${RC_UNAME}" = "Linux" ] && startopts=". -xdev -depth"
if [ "${RC_UNAME}" = "Linux" ]; then
startopts=". -xdev -depth"
# busybox find / rm cannot handle --
delete="-delete"
fi
# Faster than find # Faster than find
rm -rf [b-ikm-pr-zA-Z]* rm -rf -- [b-ikm-pr-zA-Z0-9\.]*
find ${startopts} ! -name . \ find ${startopts} ! -name . \
! -path ./lost+found \ ! -path ./lost+found \
@ -37,12 +42,12 @@ cleanup_tmp_dir()
! -path "./aquota.group/*" \ ! -path "./aquota.group/*" \
! -path ./journal \ ! -path ./journal \
! -path "./journal/*" \ ! -path "./journal/*" \
-exec rm -rf -- {} \; \ ${delete} \
-type d -prune -type d -prune
eend 0 eend 0
else else
ebegin "Cleaning ${dir} directory" ebegin "Cleaning ${dir} directory"
rm -rf "${dir}"/.X*-lock "${dir}"/esrv* "${dir}"/kio* \ rm -rf -- "${dir}"/.X*-lock "${dir}"/esrv* "${dir}"/kio* \
"${dir}"/jpsock.* "${dir}"/.fam* "${dir}"/.esd* \ "${dir}"/jpsock.* "${dir}"/.fam* "${dir}"/.esd* \
"${dir}"/orbit-* "${dir}"/ssh-* "${dir}"/ksocket-* \ "${dir}"/orbit-* "${dir}"/ssh-* "${dir}"/ksocket-* \
"${dir}"/.*-unix "${dir}"/.*-unix