diff --git a/Makefile b/Makefile index 1b0ee6370220..95a2a9b09b6c 100644 --- a/Makefile +++ b/Makefile @@ -128,7 +128,7 @@ TGTS= all all-man buildenv buildenvvars buildkernel buildworld \ build32 builddtb distribute32 install32 xdev xdev-build xdev-install \ xdev-links native-xtools stageworld stagekernel stage-packages \ create-world-packages create-kernel-packages create-packages \ - packages installconfig sign-packages + packages installconfig real-packages sign-packages TGTS+= ${SUBDIR_TARGETS} diff --git a/Makefile.inc1 b/Makefile.inc1 index 88be22c205d2..0a4671010a41 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -1374,7 +1374,10 @@ _pkgbootstrap: @env ASSUME_ALWAYS_YES=YES pkg bootstrap .endif -packages: stage-packages create-packages sign-packages +packages: + ${MAKE} -C ${.CURDIR} PKG_VERSION=${PKG_VERSION} real-packages + +real-packages: stage-packages create-packages sign-packages stage-packages: @mkdir -p ${WSTAGEDIR} ${KSTAGEDIR} @@ -1413,7 +1416,7 @@ create-world-packages: _pkgbootstrap create -M ${DESTDIR}/$${pkgname}.ucl \ -p ${DESTDIR}/$${pkgname}.plist \ -r ${DESTDIR} \ - -o ${REPODIR}/$$(pkg -o ABI_FILE=${DESTDIR}/bin/sh config ABI)/latest ; \ + -o ${REPODIR}/$$(pkg -o ABI_FILE=${DESTDIR}/bin/sh config ABI)/${PKG_VERSION} ; \ done create-kernel-packages: _pkgbootstrap @@ -1441,7 +1444,7 @@ create-kernel-packages: _pkgbootstrap create -M ${DESTDIR}/${DISTDIR}/kernel-${flavor}.ucl \ -p ${DESTDIR}/${DISTDIR}/kernel-${flavor}.plist \ -r ${DESTDIR}/${DISTDIR} \ - -o ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest + -o ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} .endfor .endif .if ${BUILDKERNELS:[#]} > 1 && !defined(NO_INSTALLEXTRAKERNELS) @@ -1470,14 +1473,22 @@ create-kernel-packages: _pkgbootstrap create -M ${DESTDIR}/kernel.${_kernel}/kernel.${_kernel}-${flavor}.ucl \ -p ${DESTDIR}/kernel.${_kernel}/kernel.${_kernel}-${flavor}.plist \ -r ${DESTDIR}/kernel.${_kernel} \ - -o ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest + -o ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} .endfor .endif .endfor .endif sign-packages: _pkgbootstrap - @pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh repo ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI) ${PKGSIGNKEY} + @[ -L "${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest" ] && \ + unlink ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest ; \ + env PKG_VERSION=${PKG_VERSION} pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh repo \ + -o ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \ + ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \ + ${PKGSIGNKEY} ; \ + env PKG_VERSION=${PKG_VERSION} \ + ln -s ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/${PKG_VERSION} \ + ${REPODIR}/$$(pkg -o ABI_FILE=${WSTAGEDIR}/bin/sh config ABI)/latest # #