summaryrefslogtreecommitdiff
path: root/archbuild
diff options
context:
space:
mode:
Diffstat (limited to 'archbuild')
-rwxr-xr-xarchbuild13
1 files changed, 13 insertions, 0 deletions
diff --git a/archbuild b/archbuild
index 7e8c456..9dd4888 100755
--- a/archbuild
+++ b/archbuild
@@ -36,6 +36,19 @@ fi
if ${clean_first} || [ ! -d "${chroots}/${repo}-${arch}" ]; then
echo "Creating chroot for [${repo}] (${arch})..."
+
+ for copy in ${chroots}/${repo}-${arch}/*; do
+ [[ -d $copy ]] || continue
+ echo "Deleting chroot copy '$(basename "${copy}")'..."
+
+ # Lock the copy
+ exec 9>${copy}.lock
+ flock 9
+
+ rm -rf ${copy}
+ done
+ exec 9>&-
+
rm -rf ${chroots}/${repo}-${arch}
mkdir -p ${chroots}/${repo}-${arch}
setarch ${arch} mkarchroot \