aboutsummaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
authorKris Kennaway <kris@FreeBSD.org>2005-10-11 03:45:49 +0000
committerKris Kennaway <kris@FreeBSD.org>2005-10-11 03:45:49 +0000
commitda7e71facd0f03e2c5cb390da268f3143c3f19b5 (patch)
treecb1e12521422679db2c993547faecbc46ebb51ec /Tools
parente93c55ca9b8a5fd5504f4ff581843c9f1619223a (diff)
downloadports-da7e71facd0f03e2c5cb390da268f3143c3f19b5.tar.gz
ports-da7e71facd0f03e2c5cb390da268f3143c3f19b5.zip
Notes
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/portbuild/scripts/clean-chroot34
1 files changed, 22 insertions, 12 deletions
diff --git a/Tools/portbuild/scripts/clean-chroot b/Tools/portbuild/scripts/clean-chroot
index 5bd3bbe38c9c..b718bc141538 100755
--- a/Tools/portbuild/scripts/clean-chroot
+++ b/Tools/portbuild/scripts/clean-chroot
@@ -37,6 +37,10 @@ branch=$2
chroot=$3
noclean=$4
+pb=/var/portbuild
+. ${pb}/${arch}/portbuild.conf
+. ${pb}/${arch}/portbuild.$(hostname)
+
# directories to clean
cleandirs="/usr/local /usr/X11R6 /compat /var/db/pkg"
@@ -54,7 +58,7 @@ fi
if [ ${arch} = "i386" ]; then
cleanup_mount ${chroot} /compat/linux/proc
fi
-
+
for i in /a/ports /usr/opt/doc /usr/src /dev; do
cleanup_mount ${chroot} ${i}
done
@@ -62,17 +66,23 @@ done
#kill_procs ${chroot}
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} >/dev/null 2>&1
- rm -rf ${chroot}${dir} >/dev/null 2>&1
+ if [ "${use_md_swap}" = "1" ]; then
+ cleanup_mount ${chroot} ""
+ mdconfig -d -u $(basename ${chroot})
+ rm -rf ${chroot}
+ else
+ rm -rf ${chroot}/tmp/*
+ for dir in ${cleandirs}; do
+ if ! rm -rf ${chroot}${dir} >/dev/null 2>&1; then
+ chflags -R noschg ${chroot}${dir} >/dev/null 2>&1
+ rm -rf ${chroot}${dir} >/dev/null 2>&1
+ 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
- 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
+ rm -rf ${chroot}/var/db/pkg/*
+ rm -rf ${chroot}/used
fi
- rm -rf ${chroot}/var/db/pkg/*
- rm -rf ${chroot}/used
fi