mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-15 06:42:51 +01:00
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: 4e224e4be7
("pkgbase: accommodate pkg < 1.17")
Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
5a49f19141
commit
4dbac528db
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user