summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-06-27 08:52:16 +0200
committerErich Eckner <git@eckner.net>2018-03-24 21:36:35 +0100
commit62abacf473647b6e9a36e65ca5b238345c0367ba (patch)
tree09de7437715b660b582dbd83fe98c67be9cdc7b5
parenta25b809889217e0c50d90aaecd3a762b712a4519 (diff)
downloaddevtools32-62abacf473647b6e9a36e65ca5b238345c0367ba.tar.xz
archbuild.in: delete old chroot more forcefully
-rw-r--r--archbuild.in10
1 files changed, 10 insertions, 0 deletions
diff --git a/archbuild.in b/archbuild.in
index 4194b68..73ae65d 100644
--- a/archbuild.in
+++ b/archbuild.in
@@ -69,6 +69,16 @@ if ${clean_first} || [[ ! -d "${chroots}/${repo}-${arch}" ]]; then
subvolume_delete_recursive "${copy}"
rm -rf --one-file-system "${copy}"
+ if [ -d "${copy}" ]; then
+ find "${copy}" \
+ -xdev -mindepth 1 -type d \
+ -exec 'mountpoint' '-q' '{}' ';' \
+ -exec 'umount' '-l' '{}' ';'
+ rm -rf --one-file-system "${copy}"
+ mountpoint -q "${copy}" && \
+ umount -l "${copy}" && \
+ rmdir "${copy}"
+ fi
done
lock_close 9