git: 5faaa602cee0 - main - pkgbase: propagate SRCRELDATE to the packages correctly

From: Baptiste Daroussin <bapt_at_FreeBSD.org>
Date: Mon, 04 Dec 2023 21:28:47 UTC
The branch main has been updated by bapt:

URL: https://cgit.FreeBSD.org/src/commit/?id=5faaa602cee093269b1a73156c95c6892b4f098d

commit 5faaa602cee093269b1a73156c95c6892b4f098d
Author:     Baptiste Daroussin <bapt@FreeBSD.org>
AuthorDate: 2023-12-04 08:22:02 +0000
Commit:     Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2023-12-04 21:27:57 +0000

    pkgbase: propagate SRCRELDATE to the packages correctly
    
    MFC After:              3 days
    Reviewed by:            manu
    Differential Revision:  https://reviews.freebsd.org/D42892
---
 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 0698a5d79a0a..d85e6fd8f15b 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -2013,6 +2013,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
@@ -2108,12 +2109,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} \
@@ -2153,6 +2158,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} \
@@ -2188,6 +2194,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 \
@@ -2224,6 +2231,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} \