summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2012-06-16 15:24:16 +0200
committerPierre Schmitz <pierre@archlinux.de>2012-06-16 15:24:16 +0200
commit0cd9e1ae7e9d52b0aa5896336c692fc2111554bd (patch)
tree3eb06e94403aaa42a0710d9cde367f90d8c148b2
parent3734c80bf74744f29543a8ffdfb00e350985e2d8 (diff)
downloaddevtools-0cd9e1ae7e9d52b0aa5896336c692fc2111554bd.tar.gz
devtools-0cd9e1ae7e9d52b0aa5896336c692fc2111554bd.tar.xz
archbuild: use flock -n as we do elsewhere
-rw-r--r--archbuild.in9
1 files changed, 6 insertions, 3 deletions
diff --git a/archbuild.in b/archbuild.in
index fb1ae17..1501a9e 100644
--- a/archbuild.in
+++ b/archbuild.in
@@ -43,9 +43,12 @@ if ${clean_first} || [[ ! -d "${chroots}/${repo}-${arch}" ]]; then
[[ -d $copy ]] || continue
msg2 "Deleting chroot copy '$(basename "${copy}")'..."
- # Lock the copy
- exec 9>"${copy}.lock"
- flock 9
+ exec 9>"$copydir.lock"
+ if ! flock -n 9; then
+ stat_busy "Locking chroot copy '$copy'"
+ flock 9
+ stat_done
+ fi
{ type -P btrfs && btrfs subvolume delete "${copy}"; } &>/dev/null
rm -rf "${copy}"