Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/makechrootpkg.in
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@parabola.nu>2017-05-05 18:40:58 -0400
committerErich Eckner <git@eckner.net>2017-07-14 06:54:28 +0200
commitc7ac915301340118ea4cbda915d664b676ad4f2d (patch)
tree7719efc22bf01f4c303a513f44744e21dcd421c1 /makechrootpkg.in
parent28871be443313ebf1c68af05439a66e01b1e2148 (diff)
makechrootpkg: delete_chroot: Fix the is-btrfs-subvolume check.
First of all, it ran `is_btrfs "$chrootdir"` to decide if it was on btrfs, but $chrootdir wasn't defined locally; it just happens to work because $chrootdir was defined in main(). (I noticed this because in Parabola, it is called differently, so $chrootdir was empty). So I was tempted to just change it to `is_btrfs "$copydir"`, but if $copydir is just a regular directory on a btrfs filesystem, then it It would leave much of $copydir intact. What we really care about is if $copydir is a btrfs subvolume; which we can check by combining the is_btrfs check with inspecting the inum of the directory. I put this combined check in lib/archroot.sh:is_subvolume. https://lists.archlinux.org/pipermail/arch-projects/2013-September/003901.html
Diffstat (limited to 'makechrootpkg.in')
-rw-r--r--makechrootpkg.in2
1 files changed, 1 insertions, 1 deletions
diff --git a/makechrootpkg.in b/makechrootpkg.in
index 3aa5f01..196cbe9 100644
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -144,7 +144,7 @@ delete_chroot() {
local copy=${1:-$2}
stat_busy "Removing chroot copy [%s]" "$copy"
- if is_btrfs "$chrootdir" && ! mountpoint -q "$copydir"; then
+ if is_subvolume "$copydir" && ! mountpoint -q "$copydir"; then
subvolume_delete_recursive "$copydir" ||
die "Unable to delete subvolume %s" "$copydir"
else