git: c8191c3d6139 - main - OptionalObsoleteFiles: Don't mark /usr/lib/debug/boot directory obsolete

From: Mark Johnston <markj_at_FreeBSD.org>
Date: Thu, 19 Feb 2026 19:15:28 UTC
The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=c8191c3d613928d8bd6060aa2f7da349b4090cc1

commit c8191c3d613928d8bd6060aa2f7da349b4090cc1
Author:     Artem Bunichev <tembun@bk.ru>
AuthorDate: 2026-02-19 19:09:48 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2026-02-19 19:09:56 +0000

    OptionalObsoleteFiles: Don't mark /usr/lib/debug/boot directory obsolete
    
    The intent of the currect code is to ignore anything under
    /usr/lib/debug/boot/*.  But we also should make sure that
    /usr/lib/debug/boot directory is also ignored and is not marked
    obsolete.  If we don't do that, `make DBATCH_DELETE_OLD_FILES
    delete-old` will try to rmdir(1) this directory, which will cause an
    error, since /usr/lib/debug/boot may have nested directories like
    kernel/ and modules/.
    
    Reviewed by:    markj
    MFC after:      2 weeks
    Differential Revision:  https://reviews.freebsd.org/D55077
---
 tools/build/mk/OptionalObsoleteFiles.inc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc
index a30ede4c1866..81379ea452bb 100644
--- a/tools/build/mk/OptionalObsoleteFiles.inc
+++ b/tools/build/mk/OptionalObsoleteFiles.inc
@@ -1443,8 +1443,8 @@ OLD_DIRS+=usr/include/fs/cuse
 
 .if ${MK_DEBUG_FILES} == no
 .if exists(${DESTDIR}/usr/lib/debug)
-DEBUG_DIRS!=find ${DESTDIR}/usr/lib/debug -mindepth 1 \
-    -type d \! -path "${DESTDIR}/usr/lib/debug/boot/*" \
+DEBUG_DIRS!=find -E ${DESTDIR}/usr/lib/debug -mindepth 1 \
+    -type d \! -regex "${DESTDIR}/usr/lib/debug/boot(/.*)?" \
     | sed -e 's,^${DESTDIR}/,,'; echo
 DEBUG_FILES!=find ${DESTDIR}/usr/lib/debug \
     \! -type d \! -path "${DESTDIR}/usr/lib/debug/boot/*" \! -name "lib*.so*" \