Hack around busybox find / rm not handling -- correctly.
This commit is contained in:
parent
8793fb8d4c
commit
829f4d281c
@ -18,11 +18,16 @@ cleanup_tmp_dir()
|
||||
cd "${dir}"
|
||||
if yesno ${wipe_tmp:-${WIPE_TMP:-yes}}; then
|
||||
ebegin "Wiping ${dir} directory"
|
||||
local startopts="-x . -depth"
|
||||
[ "${RC_UNAME}" = "Linux" ] && startopts=". -xdev -depth"
|
||||
local startopts="-x . -depth" delete="-exec rm -rf -- {} ;"
|
||||
|
||||
if [ "${RC_UNAME}" = "Linux" ]; then
|
||||
startopts=". -xdev -depth"
|
||||
# busybox find / rm cannot handle --
|
||||
delete="-delete"
|
||||
fi
|
||||
|
||||
# Faster than find
|
||||
rm -rf [b-ikm-pr-zA-Z]*
|
||||
rm -rf -- [b-ikm-pr-zA-Z0-9\.]*
|
||||
|
||||
find ${startopts} ! -name . \
|
||||
! -path ./lost+found \
|
||||
@ -37,12 +42,12 @@ cleanup_tmp_dir()
|
||||
! -path "./aquota.group/*" \
|
||||
! -path ./journal \
|
||||
! -path "./journal/*" \
|
||||
-exec rm -rf -- {} \; \
|
||||
${delete} \
|
||||
-type d -prune
|
||||
eend 0
|
||||
else
|
||||
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}"/orbit-* "${dir}"/ssh-* "${dir}"/ksocket-* \
|
||||
"${dir}"/.*-unix
|
||||
|
Loading…
Reference in New Issue
Block a user