diff options
author | kris <kris@FreeBSD.org> | 2006-02-04 04:08:18 +0800 |
---|---|---|
committer | kris <kris@FreeBSD.org> | 2006-02-04 04:08:18 +0800 |
commit | 7f88142422398739b378420c017560c772906884 (patch) | |
tree | e121b5265af7215530486f2e6b0e1e501bd645cf /Tools/portbuild | |
parent | 2692a9985b5f15fa33757b4ef923c836a46227c0 (diff) | |
download | freebsd-ports-gnome-7f88142422398739b378420c017560c772906884.tar.gz freebsd-ports-gnome-7f88142422398739b378420c017560c772906884.tar.zst freebsd-ports-gnome-7f88142422398739b378420c017560c772906884.zip |
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/portbuild')
-rwxr-xr-x | Tools/portbuild/scripts/clean-chroot | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/Tools/portbuild/scripts/clean-chroot b/Tools/portbuild/scripts/clean-chroot index 719e46f18d87..a72238432574 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 |