diff options
author | Mark Linimon <linimon@FreeBSD.org> | 2009-11-16 00:16:08 +0000 |
---|---|---|
committer | Mark Linimon <linimon@FreeBSD.org> | 2009-11-16 00:16:08 +0000 |
commit | b5923ad84659688b2d26b29d6e481bce7eab3427 (patch) | |
tree | 14d376fe6ffb200c3a92588722a91f96f5a2ab81 /Tools | |
parent | be1dbc7b939d237c2cafd5e09c96572636dbcde2 (diff) | |
download | ports-b5923ad84659688b2d26b29d6e481bce7eab3427.tar.gz ports-b5923ad84659688b2d26b29d6e481bce7eab3427.zip |
Notes
Diffstat (limited to 'Tools')
-rwxr-xr-x | Tools/portbuild/scripts/clean-chroot | 4 | ||||
-rwxr-xr-x | Tools/portbuild/scripts/cleanup-chroots | 12 |
2 files changed, 9 insertions, 7 deletions
diff --git a/Tools/portbuild/scripts/clean-chroot b/Tools/portbuild/scripts/clean-chroot index 07d7d1cb9008..7ec91af79bf8 100755 --- a/Tools/portbuild/scripts/clean-chroot +++ b/Tools/portbuild/scripts/clean-chroot @@ -24,11 +24,11 @@ cleanup_mount() { if [ -d ${chroot}${mount} ]; then mdir=$(fstat -f ${chroot}${mount} | head -2 | tail -1 | awk '{print $5}') if [ "${mdir}" = "MOUNT" ]; then - umount -f ${chroot}${mount} || echo "Cleanup of ${chroot}${mount} failed!" + umount -f ${chroot}${mount} || echo "Cleanup of ${chroot}${mount} on $(hostname) failed!" fi if [ "${mdir}" = "${chroot}${mount}" ]; then kill_procs ${chroot} ${mount} - umount -f ${chroot}${mount} || echo "Cleanup of ${chroot}${mount} failed!" + umount -f ${chroot}${mount} || echo "Cleanup of ${chroot}${mount} on $(hostname) failed!" fi fi } diff --git a/Tools/portbuild/scripts/cleanup-chroots b/Tools/portbuild/scripts/cleanup-chroots index 166f4ff7ae69..328668735e44 100755 --- a/Tools/portbuild/scripts/cleanup-chroots +++ b/Tools/portbuild/scripts/cleanup-chroots @@ -14,7 +14,7 @@ kill_procs() while [ ! -z "${pids}" ]; do pids=$(fstat -f "$dir" | tail +2 | awk '{print $3}' | sort -u) if [ ! -z "${pids}" ]; then - echo "Killing off pids in ${dir}" + echo "Killing off pids in ${dir} on $(hostname)" ps -p $pids kill -KILL ${pids} 2> /dev/null sleep 2 @@ -29,11 +29,11 @@ cleanup_mount() { if [ -d ${chroot}${mount} ]; then mdir=$(fstat -f ${chroot}${mount} | head -2 | tail -1 | awk '{print $5}') if [ "${mdir}" = "MOUNT" ]; then - umount ${chroot}${mount} || echo "Cleanup of ${chroot}${mount} failed!" + umount ${chroot}${mount} || echo "Cleanup of ${chroot}${mount} on $(hostname) failed!" fi if [ "${mdir}" = "${chroot}${mount}" ]; then kill_procs ${chroot}${mount} - umount ${chroot}${mount} || echo "Cleanup of ${chroot}${mount} failed!" + umount ${chroot}${mount} || echo "Cleanup of ${chroot}${mount} on $(hostname) failed!" fi fi } @@ -90,5 +90,7 @@ done mkdir -p ${scratchdir}/old mv ${old2} ${scratchdir}/old rm -rf ${scratchdir}/old 2> /dev/null -chflags -R noschg ${scratchdir}/old -rm -rf ${scratchdir}/old +if [ -d ${scratchdir}/old ]; then + chflags -R noschg ${scratchdir}/old + rm -rf ${scratchdir}/old +fi |