git: 44600eb7e231 - stable/14 - pkgbase: propagate SRCRELDATE to the packages correctly

From: Baptiste Daroussin <bapt_at_FreeBSD.org>
Date: Thu, 07 Dec 2023 07:48:12 UTC
The branch stable/14 has been updated by bapt:

URL: https://cgit.FreeBSD.org/src/commit/?id=44600eb7e231b0cc6c36d10031d983051cd683ee

commit 44600eb7e231b0cc6c36d10031d983051cd683ee
Author:     Baptiste Daroussin <bapt@FreeBSD.org>
AuthorDate: 2023-12-04 08:22:02 +0000
Commit:     Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2023-12-07 07:48:00 +0000

    pkgbase: propagate SRCRELDATE to the packages correctly
    
    MFC After:              3 days
    Reviewed by:            manu
    Differential Revision:  https://reviews.freebsd.org/D42892
    
    (cherry picked from commit 5faaa602cee093269b1a73156c95c6892b4f098d)
---
 Makefile.inc1                       | 12 ++++++++++--
 release/scripts/make-pkg-package.sh |  1 +
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/Makefile.inc1 b/Makefile.inc1
index 199a0f2ef0ee..ffd0b14ce87d 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -2012,6 +2012,7 @@ package-pkg: .PHONY
 	env ${WMAKEENV:Q} SRCDIR=${.CURDIR} PORTSDIR=${PORTSDIR} REVISION=${_REVISION} \
 		PKG_CMD=${PKG_CMD} PKG_VERSION=${PKG_VERSION} REPODIR=${REPODIR} \
 		WSTAGEDIR=${WSTAGEDIR} \
+		OSVERSION="${SRCRELDATE}" \
 		sh ${.CURDIR}/release/scripts/make-pkg-package.sh
 
 real-packages:	stage-packages create-packages sign-packages .PHONY
@@ -2107,12 +2108,16 @@ create-source-packages: _pkgbootstrap .PHONY
 		-e "s|%PKG_WWW%|${PKG_WWW}|" \
 		${SRCDIR}/release/packages/src-sys.ucl \
 		> ${SSTAGEDIR}/src-sys.ucl
-	${PKG_CMD} -o ABI=${PKG_ABI} create -f ${PKG_FORMAT} \
+	${PKG_CMD} -o ABI=${PKG_ABI} \
+		-o OSVERSION="${SRCRELDATE}" \
+		create -f ${PKG_FORMAT} \
 		-M ${SSTAGEDIR}/src.ucl \
 		-p ${SSTAGEDIR}/src.plist \
 		-r ${SRCDIR} \
 		-o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR}
-	${PKG_CMD} -o ABI=${PKG_ABI} create -f ${PKG_FORMAT} \
+	${PKG_CMD} -o ABI=${PKG_ABI} \
+		-o OSVERSION="${SRCRELDATE}" \
+		create -f ${PKG_FORMAT} \
 		-M ${SSTAGEDIR}/src-sys.ucl \
 		-p ${SSTAGEDIR}/src-sys.plist \
 		-r ${SRCDIR} \
@@ -2152,6 +2157,7 @@ create-world-package-${pkgname}: .PHONY
 		sed -i '' -e "s/%VCS_REVISION%/${VCS_REVISION}/" ${WSTAGEDIR}/${pkgname}.ucl ; \
 	fi
 	${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname -o ALLOW_BASE_SHLIBS=yes \
+		-o OSVERSION="${SRCRELDATE}" \
 		create -f ${PKG_FORMAT} -M ${WSTAGEDIR}/${pkgname}.ucl \
 		-p ${WSTAGEDIR}/${pkgname}.plist \
 		-r ${WSTAGEDIR} \
@@ -2187,6 +2193,7 @@ create-kernel-packages-flavor${flavor:C,^""$,${_default_flavor},}: _pkgbootstrap
 		/version/ {print $$2; next } ' \
 		${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl ; \
 	${PKG_CMD} -o ABI=${PKG_ABI} -o ALLOW_BASE_SHLIBS=yes \
+		-o OSVERSION="${SRCRELDATE}" \
 		create -f ${PKG_FORMAT} \
 		-M ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.ucl \
 		-p ${KSTAGEDIR}/${DISTDIR}/kernel.${INSTALLKERNEL}${flavor}.plist \
@@ -2223,6 +2230,7 @@ create-kernel-packages-extra-flavor${flavor:C,^""$,${_default_flavor},}-${_kerne
 		/version/ {print $$2; next } ' \
 		${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl ; \
 	${PKG_CMD} -o ABI_FILE=${WSTAGEDIR}/usr/bin/uname -o ALLOW_BASE_SHLIBS=yes \
+		-o OSVERSION="${SRCRELDATE}" \
 		create -f ${PKG_FORMAT} \
 		-M ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.ucl \
 		-p ${KSTAGEDIR}/kernel.${_kernel}/kernel.${_kernel}${flavor}.plist \
diff --git a/release/scripts/make-pkg-package.sh b/release/scripts/make-pkg-package.sh
index 25ec08f71fe6..68172c47f326 100755
--- a/release/scripts/make-pkg-package.sh
+++ b/release/scripts/make-pkg-package.sh
@@ -9,6 +9,7 @@ export WSTAGEDIR=${WSTAGEDIR}
 export REPODIR=${REPODIR}
 export PKG_CMD=${PKG_CMD}
 export PKG_VERSION=${PKG_VERSION}
+export OSVERSION=${OSVERSION}
 export WRKDIR=$(make -C ${PORTSDIR}/ports-mgmt/pkg -V WRKDIR)
 
 make -C ${PORTSDIR}/ports-mgmt/pkg TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \