summaryrefslogtreecommitdiff
path: root/makechrootpkg.in
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-06-15 11:20:37 -0600
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-06-15 11:20:37 -0600
commita8c95177c7f9bab8cb7e697c6e925b2fb1c5d342 (patch)
treeed43f04c4e2aaab033aba23fae4ead687555ca9b /makechrootpkg.in
parenta7ee45d6259e84628599f721abc297f935504fee (diff)
parenta7a05deb37b3db6aa3606f488467f621c40ce32d (diff)
downloaddevtools32-a8c95177c7f9bab8cb7e697c6e925b2fb1c5d342.tar.xz
Merge commit 'a7a0': merge our and their lock functions
Arch's have shorter names, and properly escape the filename. Ours create the directories, and check if the locks are already open. The best of both worlds. When merging the usages of them, I used arch's messages. Ours are too long, even if they are more informative.
Diffstat (limited to 'makechrootpkg.in')
-rw-r--r--makechrootpkg.in7
1 files changed, 2 insertions, 5 deletions
diff --git a/makechrootpkg.in b/makechrootpkg.in
index a0941b4..b68dc0a 100644
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -120,15 +120,12 @@ umask 0022
chroottype=$(stat -f -c %T "$chrootdir")
# Lock the chroot we want to use. We'll keep this lock until we exit.
-# Note this is the same FD number as in mkarchroot
-lock_open_write 9 "$copydir.lock" \
- "Waiting for existing lock on chroot copy to be released: [$copy]"
+lock 9 "$copydir.lock" "Locking chroot copy [$copy]"
if [[ ! -d $copydir ]] || $clean_first; then
# Get a read lock on the root chroot to make
# sure we don't clone a half-updated chroot
- lock_open_read 8 "$chrootdir/root.lock" \
- "Waiting for existing lock on clean chroot to be released"
+ slock 8 "$chrootdir/root.lock" "Locking clean chroot"
stat_busy "Creating clean working copy [$copy]"
if [[ "$chroottype" == btrfs ]]; then