Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@parabola.nu>2017-02-16 14:39:15 -0500
committerLuke Shumaker <lukeshu@parabola.nu>2017-02-19 14:21:30 -0500
commit2fa58ec7710c9f08d1422ff223bc5276703905ab (patch)
tree8329d074bc6be35a5f6d0a959516b144a92272de
parent9b93f4c12d3de7c36f4342e4e764b91ed91231f4 (diff)
makechrootpkg: Detect the chroottype in individual functions, not globally.
-rw-r--r--makechrootpkg.in12
1 files changed, 5 insertions, 7 deletions
diff --git a/makechrootpkg.in b/makechrootpkg.in
index cdc3a93..f90e20d 100644
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -180,8 +180,6 @@ btrfs_subvolume_delete() {
}
# Usage: sync_chroot $CHROOTDIR/$CHROOT <$CHROOTCOPY|$copydir>
-# Globals:
-# - chroottype
sync_chroot() {
local chrootdir=$1
local copy=$2
@@ -197,6 +195,9 @@ sync_chroot() {
return 1
fi
+ # Detect chrootdir filesystem type
+ local chroottype=$(stat -f -c %T "$chrootdir")
+
# Get a read lock on the root chroot to make
# sure we don't clone a half-updated chroot
slock 8 "$chrootdir/root.lock" \
@@ -224,10 +225,10 @@ sync_chroot() {
}
# Usage: delete_chroot $copydir
-# Globals:
-# - chroottype
delete_chroot() {
local copydir=$1
+ # Detect chrootdir filesystem type
+ local chroottype=$(stat -f -c %T "$copydir")
stat_busy "Removing chroot copy [%s]" "$copydir"
if [[ "$chroottype" == btrfs ]] && ! mountpoint -q "$copydir"; then
@@ -418,9 +419,6 @@ chrootdir=$(readlink -e "$passeddir")
[[ ! -d $chrootdir ]] && die "No chroot dir defined, or invalid path '%s'" "$passeddir"
[[ ! -d $chrootdir/root ]] && die "Missing chroot dir root directory. Try using: mkarchroot %s/root base-devel" "$chrootdir"
-# Detect chrootdir filesystem type
-chroottype=$(stat -f -c %T "$chrootdir")
-
if [[ ${copy:0:1} = / ]]; then
copydir=$copy
else