diff options
author | Kris Kennaway <kris@FreeBSD.org> | 2006-02-15 07:42:30 +0000 |
---|---|---|
committer | Kris Kennaway <kris@FreeBSD.org> | 2006-02-15 07:42:30 +0000 |
commit | d270e5ec990e828532013e0e986ca5fa25291ac2 (patch) | |
tree | cce4feea9a1ce51c0ec8cccfb16c8060a55aa816 /Tools | |
parent | bb3de95c2974358c75e16c9cfdcb800104f5677d (diff) | |
download | ports-d270e5ec990e828532013e0e986ca5fa25291ac2.tar.gz ports-d270e5ec990e828532013e0e986ca5fa25291ac2.zip |
Notes
Diffstat (limited to 'Tools')
-rwxr-xr-x | Tools/portbuild/scripts/claim-chroot | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/Tools/portbuild/scripts/claim-chroot b/Tools/portbuild/scripts/claim-chroot index 52bf12bbb4d7..c04c3866d523 100755 --- a/Tools/portbuild/scripts/claim-chroot +++ b/Tools/portbuild/scripts/claim-chroot @@ -2,6 +2,12 @@ # usage: claim-chroot ${arch} ${branch} ${pkgname} +# This script cannot output anything except the name of the successfully +# claimed chroot. In case of error, just exit. + +# XXX Return the string "chroot=*" and look for that in pdispatch to make +# this more robust + # configurable variables pb=/var/portbuild @@ -13,7 +19,6 @@ shift . ${pb}/scripts/buildenv buildroot=${scratchdir} -error=0 branch=$1 shift @@ -24,6 +29,30 @@ pkgname=$(basename $1 ${PKGSUFFIX}) chrootdir=${buildroot}/${branch}/chroot +# Perform initial sanity check + +if [ ! -z "${squid_dir}" ]; then + /usr/local/sbin/squid -k check 2> /dev/null + status=$? + if [ "${status}" != "0" ]; then + touch ${scratchdir}/.squid + /usr/local/etc/rc.d/squid.sh start > /dev/null & + exit 1 + else + rm -f ${scratchdir}/.squid + fi +fi + +# Check for enough disk space +df=$(df -k ${scratchdir} | tail -1 | awk '{print $4}') + +if [ ${df} -lt 102400 ]; then + touch ${scratchdir}/.disk + exit 1 +else + rm -f ${scratchdir}/.disk +fi + found=0 # Look for pre-existing chroot directories that are populated and unused for dir in ${chrootdir}/*; do |