mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-24 00:45:52 +00:00
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
This commit is contained in:
parent
a65bd63641
commit
b762d9e066
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=155143
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user