Re: git: f7c0bd206fe4 - main - file: normalize .result files to ensure trailing newline on install
- Reply: Dag-Erling_Smørgrav : "Re: git: f7c0bd206fe4 - main - file: normalize .result files to ensure trailing newline on install"
- In reply to: Xin LI : "git: f7c0bd206fe4 - main - file: normalize .result files to ensure trailing newline on install"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 05 Jun 2026 15:34:39 UTC
On Fri Jun 5, 2026 at 66:00 UTC, Xin LI <delphij@FreeBSD.org> wrote:
> The branch main has been updated by delphij:
>
> URL: https://cgit.FreeBSD.org/src/commit/?id=f7c0bd206fe4f3a956b3ecb4dc11a7386b85fa22
>
> commit f7c0bd206fe4f3a956b3ecb4dc11a7386b85fa22
> Author: Xin LI <delphij@FreeBSD.org>
> AuthorDate: 2026-06-05 04:47:08 +0000
> Commit: Xin LI <delphij@FreeBSD.org>
> CommitDate: 2026-06-05 04:48:19 +0000
>
> file: normalize .result files to ensure trailing newline on install
>
> Some upstream result files introduced in file 5.47 (e.g., bgcode.result)
> lack a trailing newline, causing the contrib_file_tests ATF test to
> fail with "cmp: EOF on bgcode.result". Generate normalized copies
> of the expected results and install those instead.
>
> MFC after: 3 days
> Fixes: e949ce9dc0e6fff26e83904f1008b76d36ba0a37
> ---
> usr.bin/file/tests/Makefile | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/usr.bin/file/tests/Makefile b/usr.bin/file/tests/Makefile
> index cd3d00ae742c..cdbe994e1c93 100644
> --- a/usr.bin/file/tests/Makefile
> +++ b/usr.bin/file/tests/Makefile
> @@ -2,7 +2,18 @@ PACKAGE= tests
> ATF_TESTS_SH= file_test
>
> SRCDIR= ${SRCTOP}/contrib/file/tests
> -_files!= echo ${SRCDIR}/*.testfile ${SRCDIR}/*.flags ${SRCDIR}/*.result ${SRCDIR}/*.magic
> +_files!= echo ${SRCDIR}/*.testfile ${SRCDIR}/*.flags ${SRCDIR}/*.magic
> +_results!= echo ${SRCDIR}/*.result
> ${PACKAGE}FILES+=${_files}
>
> +# Generate normalized .result files in the obj directory, ensuring each ends
> +# with a newline (some upstream result files are missing one). Install those
> +# instead of the originals from contrib.
> +.for _r in ${_results}
> +${_r:T}: ${_r}
> + awk 1 ${.ALLSRC} > ${.TARGET}
> +${PACKAGE}FILES+= ${_r:T}
> +CLEANFILES+= ${_r:T}
> +.endfor
> +
> .include <bsd.test.mk>
Thanks for the fix to src. I've submitted the fix upstream
here (needs an account): https://bugs.astron.com/view.php?id=775. We
should revert this change after `file`'s next release.