diff options
| author | Ed Maste <emaste@FreeBSD.org> | 2021-07-27 16:44:45 +0000 |
|---|---|---|
| committer | Ed Maste <emaste@FreeBSD.org> | 2021-07-27 18:50:06 +0000 |
| commit | 4e224e4be7c37052567ec4cd2481f299487fc222 (patch) | |
| tree | 3d75e45c5596d11514787ab1d1729996fbe4195d | |
| parent | 674400eb20b65369a88b1cb778d729bc297832c9 (diff) | |
| download | src-4e224e4be7c37052567ec4cd2481f299487fc222.tar.gz src-4e224e4be7c37052567ec4cd2481f299487fc222.zip | |
pkgbase: accommodate pkg < 1.17
6cafdee71d2b adapted the pkgbase build for 1.17, but broke Cirrus-CI's
use of PKG_FORMAT=tar (the quarterly package set still has pkg 1.16).
Because of this I disabled the pkgbase build and test in 2bfba2a04b05.
Now, check `pkg --version` and use the old logic for < 1.17.
To be reverted once we no longer encounter pkg 1.16 in Cirrus-CI (i.e.,
via GCP cloud images) to avoid keeping this extra complexity around.
PR: 257422
Reviewed by: manu
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D31324
| -rw-r--r-- | Makefile.inc1 | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1 index f7e8f9c41d2f..23fb4b5581ac 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1857,9 +1857,15 @@ _pkgbootstrap: .PHONY @env ASSUME_ALWAYS_YES=YES pkg bootstrap .endif -.if make(create-world-packages-jobs) || make(create-kernel-packages*) || make(real-update-packages) +.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}' +.if ${PKG_BIN_VERSION} < 11700 +PKG_EXT= ${PKG_FORMAT} +.else +PKG_EXT= pkg +.endif .if !defined(PKG_VERSION_FROM) && make(real-update-packages) .if defined(PKG_ABI) @@ -1899,14 +1905,14 @@ real-update-packages: stage-packages .PHONY @echo "==> Checking for new packages (comparing ${PKG_VERSION} to ${PKG_VERSION_FROM})" @for pkg in ${PKG_VERSION_FROM_DIR}/${PKG_NAME_PREFIX}-*; do \ pkgname=$$(pkg query -F $${pkg} '%n' | sed 's/${PKG_NAME_PREFIX}-\(.*\)/\1/') ; \ - newpkgname=${PKG_NAME_PREFIX}-$${pkgname}-${PKG_VERSION}.pkg ; \ + newpkgname=${PKG_NAME_PREFIX}-$${pkgname}-${PKG_VERSION}.${PKG_EXT} ; \ oldsum=$$(pkg query -F $${pkg} '%X') ; \ if [ ! -f ${REPODIR}/${PKG_ABI}/${PKG_VERSION}/$${newpkgname} ]; then \ continue; \ fi ; \ newsum=$$(pkg query -F ${REPODIR}/${PKG_ABI}/${PKG_VERSION}/$${newpkgname} '%X') ; \ if [ "$${oldsum}" == "$${newsum}" ]; then \ - echo "==> Keeping old ${PKG_NAME_PREFIX}-$${pkgname}-${PKG_VERSION_FROM}.pkg" ; \ + echo "==> Keeping old ${PKG_NAME_PREFIX}-$${pkgname}-${PKG_VERSION_FROM}.${PKG_EXT}" ; \ rm ${REPODIR}/${PKG_ABI}/${PKG_VERSION}/$${newpkgname} ; \ cp $${pkg} ${REPODIR}/${PKG_ABI}/${PKG_VERSION} ; \ else \ @@ -2064,6 +2070,9 @@ create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_kerne sign-packages: _pkgbootstrap .PHONY printf "version = 2;\n" > ${WSTAGEDIR}/meta +.if ${PKG_BIN_VERSION} < 11700 + printf "packing_format = \"${PKG_FORMAT}\";\n" >> ${WSTAGEDIR}/meta +.endif @[ -L "${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/latest" ] && \ unlink ${REPODIR}/$$(${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname config ABI)/latest ; \ ${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname repo \ |
