Add -x to the removal of trees to prevent crossing mount points to

limit the damage from errored out runs and failure to unmount loopback
mounts properly.
This commit is contained in:
Warner Losh 2014-04-18 16:53:56 +00:00
parent 77667fecbe
commit d608bbf41b

View File

@ -184,9 +184,9 @@ nano_cleanup ( ) (
clean_build ( ) (
pprint 2 "Clean and create object directory (${MAKEOBJDIRPREFIX})"
if ! rm -rf ${MAKEOBJDIRPREFIX} > /dev/null 2>&1 ; then
chflags -R noschg ${MAKEOBJDIRPREFIX}
rm -r ${MAKEOBJDIRPREFIX}
if ! rm -xrf ${MAKEOBJDIRPREFIX}/ > /dev/null 2>&1 ; then
chflags -R noschg ${MAKEOBJDIRPREFIX}/
rm -xr ${MAKEOBJDIRPREFIX}/
fi
mkdir -p ${MAKEOBJDIRPREFIX}
printenv > ${MAKEOBJDIRPREFIX}/_.env
@ -240,17 +240,17 @@ build_kernel ( ) (
clean_world ( ) (
if [ "${NANO_OBJ}" != "${MAKEOBJDIRPREFIX}" ]; then
pprint 2 "Clean and create object directory (${NANO_OBJ})"
if ! rm -rf ${NANO_OBJ} > /dev/null 2>&1 ; then
if ! rm -rxf ${NANO_OBJ}/ > /dev/null 2>&1 ; then
chflags -R noschg ${NANO_OBJ}
rm -r ${NANO_OBJ}
rm -xr ${NANO_OBJ}/
fi
mkdir -p ${NANO_OBJ} ${NANO_WORLDDIR}
printenv > ${NANO_OBJ}/_.env
else
pprint 2 "Clean and create world directory (${NANO_WORLDDIR})"
if ! rm -rf ${NANO_WORLDDIR}/ > /dev/null 2>&1 ; then
if ! rm -rxf ${NANO_WORLDDIR}/ > /dev/null 2>&1 ; then
chflags -R noschg ${NANO_WORLDDIR}
rm -rf ${NANO_WORLDDIR}
rm -rxf ${NANO_WORLDDIR}/
fi
mkdir -p ${NANO_WORLDDIR}
fi
@ -758,7 +758,7 @@ cust_pkg () (
exit 2
fi
done
rm -rf ${NANO_WORLDDIR}/Pkg
rm -rxf ${NANO_WORLDDIR}/Pkg
)
cust_pkgng () (
@ -827,7 +827,7 @@ cust_pkgng () (
exit 2
fi
done
rm -rf ${NANO_WORLDDIR}/Pkg
rm -rxf ${NANO_WORLDDIR}/Pkg
)
#######################################################################