Hi, Quoting Clément Hermann (2018-07-27 08:59:41) > while following https://www.eyrie.org/~eagle/notes/debian/sbuild.html to > create a sbuild setup using btrfs, the sbuild creation on a btrfs > subvolume fails: > > sbuild-createchroot --arch=amd64 --include=debhelper,eatmydata \ > --components=main,contrib,non-free sid \ > /var/lib/schroot.sbuild/sid-amd64-sbuild \ > http://localhost:3142/debian > /var/lib/schroot.sbuild/sid-amd64-sbuild is not empty at > /usr/bin/sbuild-createchroot line 278. > > Of course, the subvolume was just created, and it is empty. However, you > can't rmdir the directory of a btrfs subvolume, so the check fails for > the wrong reason. > > I believe this is due to the fix of #888710.
Yes, I fixed the bug by doing the "empty directory check" via first doing an rmdir because that would fail if the directory is non-empty. I thought that would be a very clever solution but of course there are more reasons because of which an rmdir might fail. > Maybe checking if this is a mountpoint / btrfs subvolume first ? This would just overcomplicate matters. I guess instead of trying to be clever, I should just implement a more traditional way of checking whether a directory is empty in Perl: https://stackoverflow.com/a/32961012/784669 Thanks! cheers, josch
signature.asc
Description: signature