From 62abacf473647b6e9a36e65ca5b238345c0367ba Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 27 Jun 2017 08:52:16 +0200 Subject: archbuild.in: delete old chroot more forcefully --- archbuild.in | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 -- cgit v1.2.3-70-g09d2