Re: awk behaviour?

From: Ed Maste <emaste_at_freebsd.org>
Date: Wed, 28 Jul 2021 20:02:30 UTC
On Wed, 28 Jul 2021 at 15:15, Michael Butler via freebsd-current
<freebsd-current@freebsd.org> wrote:
>
> What prompted the question was my (obviously poor) attempt to debug and
> resolve this failure when attempting to build a release for i386 on an
> amd64 ..

This will be due to my 4e224e4be7c3. I'm not sure exactly what's
happening yet, but I can provoke this behaviour if `${PKG_CMD}
--version` outputs something other than a single line with the version
number.

Can you give this change a try:

diff --git a/Makefile.inc1 b/Makefile.inc1
index 23fb4b5581ac..9ef954e0678c 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -1860,7 +1860,7 @@ _pkgbootstrap: .PHONY
 .if make(create-world-packages-jobs) || make(create-kernel-packages*)
|| make(real-update-packages) || make(sign-packages)
 PKG_ABI!=${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI
 .endif
-PKG_BIN_VERSION!=${PKG_CMD} --version | awk -F. '{print $$1 * 10000 +
$$2 * 100 + $$3}'
+PKG_BIN_VERSION!=${PKG_CMD} --version | awk -F. '/^[0-9.]+$$/ {print
$$1 * 10000 + $$2 * 100 + $$3}'
 .if ${PKG_BIN_VERSION} < 11700
 PKG_EXT=       ${PKG_FORMAT}
 .else