archbuild: use flock -n as we do elsewhere
This commit is contained in:
parent
3734c80bf7
commit
0cd9e1ae7e
|
@ -43,9 +43,12 @@ if ${clean_first} || [[ ! -d "${chroots}/${repo}-${arch}" ]]; then
|
||||||
[[ -d $copy ]] || continue
|
[[ -d $copy ]] || continue
|
||||||
msg2 "Deleting chroot copy '$(basename "${copy}")'..."
|
msg2 "Deleting chroot copy '$(basename "${copy}")'..."
|
||||||
|
|
||||||
# Lock the copy
|
exec 9>"$copydir.lock"
|
||||||
exec 9>"${copy}.lock"
|
if ! flock -n 9; then
|
||||||
flock 9
|
stat_busy "Locking chroot copy '$copy'"
|
||||||
|
flock 9
|
||||||
|
stat_done
|
||||||
|
fi
|
||||||
|
|
||||||
{ type -P btrfs && btrfs subvolume delete "${copy}"; } &>/dev/null
|
{ type -P btrfs && btrfs subvolume delete "${copy}"; } &>/dev/null
|
||||||
rm -rf "${copy}"
|
rm -rf "${copy}"
|
||||||
|
|
Loading…
Reference in New Issue