Date: Wed, 28 Jul 2021 21:15:50 GMT From: Ed Maste <emaste@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 4dbac528db60 - main - pkgbase: improve pkg --version parsing Message-ID: <202107282115.16SLFok3056558@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=4dbac528db6040694cd57c42a64e036daa91db86 commit 4dbac528db6040694cd57c42a64e036daa91db86 Author: Ed Maste <emaste@FreeBSD.org> AuthorDate: 2021-07-28 20:02:49 +0000 Commit: Ed Maste <emaste@FreeBSD.org> CommitDate: 2021-07-28 21:14:33 +0000 pkgbase: improve pkg --version parsing In some cases `pkg --version` might produce unexpected or additional output. Use a regex /^[0-9.]+$/ to match only the line containing the version number. Reported by: Michael Butler on freebsd-current@ Fixes: 4e224e4be7c3 ("pkgbase: accommodate pkg < 1.17") Sponsored by: The FreeBSD Foundation --- Makefile.inc1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202107282115.16SLFok3056558>