Index: head/Tools/portbuild/scripts/clean-chroot =================================================================== --- head/Tools/portbuild/scripts/clean-chroot (revision 118446) +++ head/Tools/portbuild/scripts/clean-chroot (revision 118447) @@ -1,36 +1,41 @@ #!/bin/sh arch=$1 branch=$2 chroot=$3 noclean=$4 # directories to clean cleandirs="/usr/local /usr/X11R6 /compat /var/db/pkg" +if [ `realpath ${chroot}` = "/" ]; then + # Don't spam the root file system if something has gone wrong! + exit 1 +fi + #umount ${chroot}/proc if [ ${arch} = "i386" ]; then chroot ${chroot} umount -f /compat/linux/proc fi umount -f ${chroot}/a/ports umount -f ${chroot}/usr/opt/doc umount -f ${chroot}/usr/src umount -f ${chroot}/dev if [ $noclean = 0 ]; then rm -rf ${chroot}/tmp/* for dir in ${cleandirs}; do if ! rm -rf ${chroot}${dir} >/dev/null 2>&1; then chflags -R noschg ${chroot}${dir} rm -rf ${chroot}${dir} >/dev/null 2>&1 fi done chroot ${chroot} /sbin/ldconfig -R if [ ${arch} = "i386" ]; then chroot ${chroot} /sbin/ldconfig -aout -R fi rm -rf ${chroot}/var/db/pkg/* rm -rf ${chroot}/used fi Property changes on: head/Tools/portbuild/scripts/clean-chroot ___________________________________________________________________ Modified: cvs2svn:cvs-rev ## -1 +1 ## -1.1 \ No newline at end of property +1.2 \ No newline at end of property