From f5cb3e0048f060a88704214c20d9e60bb896d88a Mon Sep 17 00:00:00 2001 From: lotherk Date: Tue, 24 Nov 2026 09:14:56 +0000 Subject: [PATCH] pkgchroot: remove the mount points after the unmount checkflist stopped the MacBook release with 105 extra files in DESTDIR: ./mnt/dev, ./mnt/pkgsrc, ./mnt/work ... (the sandbox's mount points), plus debris of earlier runs (a nested usr/src tree, var/tmp/cwdtest*, dev/null, etc/usermgmt.conf), which were removed from build/obj by hand. The mount points are rmdir'ed now, never rm -rf'ed: a mounted directory is not touched. Co-Authored-By: Claude Sonnet 5.5 --- tools/pkgchroot.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/pkgchroot.sh b/tools/pkgchroot.sh index 4723f3446a..eda01e34dc 100755 --- a/tools/pkgchroot.sh +++ b/tools/pkgchroot.sh @@ -34,6 +34,13 @@ umount_all() umount "$t" || break done done + # The mount points are not part of any set: checkflist listed ./mnt/dev, + # ./mnt/pkgsrc ... as extra files (measured 2026-11-24, MacBook). rmdir, never + # rm -rf: on a directory that is still mounted it fails and removes nothing. + for t in "$MNT"/*; do + [ -d "$t" ] && rmdir "$t" 2>/dev/null + done + return 0 } sandbox_mount()