git: a93799b55d2d - stable/13 - kmod.mk: Use portable printf '%s' over non-portable echo -n
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 01 Aug 2023 21:06:53 UTC
The branch stable/13 has been updated by jrtc27:
URL: https://cgit.FreeBSD.org/src/commit/?id=a93799b55d2d2feb552c4b2af9318bacb13d8104
commit a93799b55d2d2feb552c4b2af9318bacb13d8104
Author: Jessica Clarke <jrtc27@FreeBSD.org>
AuthorDate: 2023-07-11 20:30:06 +0000
Commit: Jessica Clarke <jrtc27@FreeBSD.org>
CommitDate: 2023-08-01 20:42:53 +0000
kmod.mk: Use portable printf '%s' over non-portable echo -n
Whilst /bin/echo on macOS and Linux implement -n, as do the builtin
echos in bash and zsh, the builtin echo in dash does not, causing the
first line of the output to be -n foo rather than just foo, and there to
be an extra newline in the output and thus blank line, both of which
result in "Symbol ... is not present in *.kld" warnings appearing in the
build output (once for -n foo and once for the empty string for each
module where EXPORT_SYMS is a list of symbols).
MFC after: 1 week
(cherry picked from commit d1e44bc94494448de196948d698b637b6e1df4bf)
---
sys/conf/kmod.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk
index 4a0d828f0159..777bd91a313b 100644
--- a/sys/conf/kmod.mk
+++ b/sys/conf/kmod.mk
@@ -275,7 +275,7 @@ ${FULLPROG}: ${OBJS}
.if ${EXPORT_SYMS} == NO
:> export_syms
.elif !exists(${.CURDIR}/${EXPORT_SYMS})
- echo -n "${EXPORT_SYMS:@s@$s${.newline}@}" > export_syms
+ printf '%s' "${EXPORT_SYMS:@s@$s${.newline}@}" > export_syms
.else
grep -v '^#' < ${EXPORT_SYMS} > export_syms
.endif