aboutsummaryrefslogtreecommitdiffstats
path: root/Tools/portbuild
diff options
context:
space:
mode:
authorlinimon <linimon@FreeBSD.org>2009-11-16 08:16:08 +0800
committerlinimon <linimon@FreeBSD.org>2009-11-16 08:16:08 +0800
commita051fb16ec3b24c7665afc294b0b6920a3a3ab73 (patch)
treea15132243e52fffb38a8b15f4583d883891f5efa /Tools/portbuild
parent2bb652bccb438d2cfcd2b41c012ee35ebd56f6d9 (diff)
downloadfreebsd-ports-gnome-a051fb16ec3b24c7665afc294b0b6920a3a3ab73.tar.gz
freebsd-ports-gnome-a051fb16ec3b24c7665afc294b0b6920a3a3ab73.tar.zst
freebsd-ports-gnome-a051fb16ec3b24c7665afc294b0b6920a3a3ab73.zip
Harden these a bit: make them identify on which host they were running;
skip unncessary steps.
Diffstat (limited to 'Tools/portbuild')
-rwxr-xr-xTools/portbuild/scripts/clean-chroot4
-rwxr-xr-xTools/portbuild/scripts/cleanup-chroots12
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