diff --git a/archbuild.in b/archbuild.in index 9f9633cde961594e3177f6c23259ee50a1a8e251..bdb18c051c1d0e7362df10be044461b22573c3c0 100644 --- a/archbuild.in +++ b/archbuild.in @@ -58,7 +58,9 @@ if ${clean_first} || [[ ! -d "${chroots}/${repo}-${arch}" ]]; then stat_done fi - { type -P btrfs && btrfs subvolume delete "${copy}"; } &>/dev/null + if [[ "$(stat -f -c %T "${copy}")" == btrfs ]]; then + { type -P btrfs && btrfs subvolume delete "${copy}"; } &>/dev/null + fi rm -rf --one-file-system "${copy}" done exec 9>&- diff --git a/mkarchroot.in b/mkarchroot.in index 9059cdb1dfaf2c0d98f0ba092934badfbe45ab54..ff9d7eba2f5cdc72acd0ff8185c5e20e5e360c31 100644 --- a/mkarchroot.in +++ b/mkarchroot.in @@ -160,8 +160,10 @@ else mkdir -p "${working_dir}" fi - if { type -P btrfs && btrfs subvolume create "${working_dir}"; } &>/dev/null; then - chmod 0755 "${working_dir}" + if [[ "$(stat -f -c %T "${working_dir}")" == btrfs ]]; then + if { type -P btrfs && btrfs subvolume create "${working_dir}"; } &>/dev/null; then + chmod 0755 "${working_dir}" + fi fi chroot_lock