build: fix list-old-dirs / check-old-dirs

Fix list-old-dirs to not generate empty line at the end of the
output if OLD_DIRS happens to have a space at the end of the
last word of the output before the final \n. Then that space
is turned into \n and we end up with a blank line.

Futhermore this gets converted into a "/" i.e. root fs when
calling check-old-dirs.

This is the regression since a8267ecc3d.

Reviewed by:	emaste
Approved by:	emaste
Sponsored by:	Sippy Software, Inc.
Differential Revision:	https://reviews.freebsd.org/D52153
MFC After:	3 days
This commit is contained in:
Maxim Sobolev
2025-08-25 15:00:14 -07:00
parent 0886019bf8
commit ebf862fb55
+1 -1
View File
@@ -3712,7 +3712,7 @@ check-old-libs: .PHONY
list-old-dirs: .PHONY
@cd ${.CURDIR}; \
${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
-V OLD_DIRS | sed -E 's/[[:space:]]+/\n/g' | sort -r
-V "OLD_DIRS:ts\n" | sort -r
delete-old-dirs: .PHONY
@echo ">>> Removing old directories"