aboutsummaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorMark Linimon <linimon@FreeBSD.org>2010-06-25 23:04:53 +0000
committerMark Linimon <linimon@FreeBSD.org>2010-06-25 23:04:53 +0000
commitecc847e0d69e439f961c58a14101ab84433e31ea (patch)
tree28d2be2c0c92b22b4942b393402075f8a0fbbb81 /Tools
parent1629562d009129c265400a85a02e7923296a2842 (diff)
Notes
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/portbuild/scripts/clean-chroot28
1 files changed, 17 insertions, 11 deletions
diff --git a/Tools/portbuild/scripts/clean-chroot b/Tools/portbuild/scripts/clean-chroot
index 7ec91af79bf8..aeab24219d36 100755
--- a/Tools/portbuild/scripts/clean-chroot
+++ b/Tools/portbuild/scripts/clean-chroot
@@ -1,4 +1,7 @@
#!/bin/sh
+# $FreeBSD$
+
+# client-side script to clean up a chroot
kill_procs()
{
@@ -40,13 +43,10 @@ chroot=$4
clean=$5
pb=/var/portbuild
+
+. ${pb}/${arch}/client.conf
. ${pb}/${arch}/portbuild.conf
. ${pb}/${arch}/portbuild.$(hostname)
-. ${pb}/scripts/buildenv
-
-builddir=${pb}/${arch}/${branch}/builds/${buildid}
-
-buildenv ${pb} ${arch} ${branch} ${builddir}
# directories to clean
cleandirs="${LOCALBASE} /compat /var/db/pkg"
@@ -67,9 +67,12 @@ fi
#umount ${chroot}/proc
-if [ ${arch} = "i386" -o ${arch} = "amd64" ]; then
- cleanup_mount ${chroot} /compat/linux/proc
-fi
+for i in ${ARCHS_REQUIRING_LINPROCFS}; do
+ if [ ${i} = ${arch} ]; then
+ cleanup_mount ${chroot} /compat/linux/proc
+ break
+ fi
+done
for i in /a/ports /usr/src /dev /root/.ccache; do
cleanup_mount ${chroot} ${i}
@@ -103,9 +106,12 @@ else
fi
done
test -x ${chroot}/sbin/ldconfig && chroot ${chroot} /sbin/ldconfig -R
- if [ ${arch} = "i386" ]; then
- test -x ${chroot}/sbin/ldconfig && chroot ${chroot} /sbin/ldconfig -aout -R
- fi
+ for i in ${ARCHS_REQUIRING_AOUT_COMPAT}; do
+ if [ ${i} = ${arch} ]; then
+ test -x ${chroot}/sbin/ldconfig && chroot ${chroot} /sbin/ldconfig -aout -R
+ break
+ fi
+ done
rm -rf ${chroot}/var/db/pkg/*
rm -rf ${chroot}/used
elif [ "${clean}" = 2 ]; then