summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorkris <kris@FreeBSD.org>2006-02-03 20:08:18 +0000
committerkris <kris@FreeBSD.org>2006-02-03 20:08:18 +0000
commit7f88142422398739b378420c017560c772906884 (patch)
treee121b5265af7215530486f2e6b0e1e501bd645cf /Tools
parent2692a9985b5f15fa33757b4ef923c836a46227c0 (diff)
downloadFreeBSD-ports-7f88142422398739b378420c017560c772906884.zip
FreeBSD-ports-7f88142422398739b378420c017560c772906884.tar.gz
Instead of passing in a "noclean" boolean, pass in a "clean" level:
0 = don't clean chroot 1 = sanitize commonly-modified directories 2 = remove entire chroot
Diffstat (limited to 'Tools')
-rwxr-xr-xTools/portbuild/scripts/clean-chroot15
1 files changed, 11 insertions, 4 deletions
diff --git a/Tools/portbuild/scripts/clean-chroot b/Tools/portbuild/scripts/clean-chroot
index 719e46f..a722384 100755
--- a/Tools/portbuild/scripts/clean-chroot
+++ b/Tools/portbuild/scripts/clean-chroot
@@ -35,7 +35,7 @@ cleanup_mount() {
arch=$1
branch=$2
chroot=$3
-noclean=$4
+clean=$4
pb=/var/portbuild
. ${pb}/${arch}/portbuild.conf
@@ -67,12 +67,14 @@ done
#kill_procs ${chroot}
-if [ $noclean = 0 ]; then
- if [ "${use_md_swap}" = "1" ]; then
+if [ "${use_md_swap}" = "1" ]; then
+ if [ "${clean}" -gt "0" ]; then
cleanup_mount ${chroot} ""
mdconfig -d -u $(basename ${chroot})
rm -rf ${chroot}
- else
+ fi
+else
+ if [ "${clean}" = 1 ]; then
rm -rf ${chroot}/tmp/*
for dir in ${cleandirs}; do
if ! rm -rf ${chroot}${dir} >/dev/null 2>&1; then
@@ -86,5 +88,10 @@ if [ $noclean = 0 ]; then
fi
rm -rf ${chroot}/var/db/pkg/*
rm -rf ${chroot}/used
+ elif [ "${clean}" = 2 ]; then
+ if ! rm -rf ${chroot} >/dev/null 2>&1; then
+ chflags -R noschg ${chroot} >/dev/null 2>&1
+ rm -rf ${chroot} >/dev/null 2>&1
+ fi
fi
fi
OpenPOWER on IntegriCloud