From c53a3e80170dc9d45beeeb623edfbf0bd40799a7 Mon Sep 17 00:00:00 2001 From: "Jan Alexander Steffens (heftig)" Date: Tue, 7 Mar 2017 19:55:05 +0100 Subject: lib/archroot.sh: Add is_btrfs helper --- makechrootpkg.in | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'makechrootpkg.in') diff --git a/makechrootpkg.in b/makechrootpkg.in index 695b898..9e84996 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -96,7 +96,7 @@ create_chroot() { slock 8 "$chrootdir/root.lock" "Locking clean chroot" stat_busy "Creating clean working copy [$copy]" - if [[ "$chroottype" == btrfs ]] && ! mountpoint -q "$copydir"; then + if is_btrfs "$chrootdir" && ! mountpoint -q "$copydir"; then if [[ -d $copydir ]]; then btrfs subvolume delete "$copydir" >/dev/null || die "Unable to delete subvolume %s" "$copydir" @@ -119,7 +119,7 @@ create_chroot() { clean_temporary() { stat_busy "Removing temporary copy [$copy]" - if [[ "$chroottype" == btrfs ]] && ! mountpoint -q "$copydir"; then + if is_btrfs "$chrootdir" && ! mountpoint -q "$copydir"; then btrfs subvolume delete "$copydir" >/dev/null || die "Unable to delete subvolume %s" "$copydir" else @@ -285,9 +285,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 -- cgit v1.2.3-70-g09d2