git: 8549e3ce0cd6 - main - pkgbase: don't remove the 'latest' symlink until the repo is final
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 29 Oct 2024 20:50:56 UTC
The branch main has been updated by kevans:
URL: https://cgit.FreeBSD.org/src/commit/?id=8549e3ce0cd6d4a6187b3977d53ff56ce0ac9c5b
commit 8549e3ce0cd6d4a6187b3977d53ff56ce0ac9c5b
Author: Kyle Evans <kevans@FreeBSD.org>
AuthorDate: 2024-10-29 20:50:49 +0000
Commit: Kyle Evans <kevans@FreeBSD.org>
CommitDate: 2024-10-29 20:50:49 +0000
pkgbase: don't remove the 'latest' symlink until the repo is final
We can encounter many issues in the pkg-repo(8) process which would
currently leave us with no more 'latest' symlink in the repository. The
main problems with this are that we've now broken a subsequent
`update-packages` because we can't determine a PKG_VERSION_FROM, but
also we break configured clients that are still expecting to see *some*
repository.
Switch to just replacing the `latest` symlink entirely after we have
made it past the pkg-repo(8) step so that we only swap over when we have
a finished repository.
Reviewed by: bapt, emaste
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D47303
---
Makefile.inc1 | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/Makefile.inc1 b/Makefile.inc1
index 69a1ad2c8d01..4bd85a8cbf04 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -2367,14 +2367,13 @@ real-sign-packages: _pkgbootstrap .PHONY
.if ${PKG_BIN_VERSION} < 11700
printf "packing_format = \"${PKG_FORMAT}\";\n" >> ${WSTAGEDIR}/meta
.endif
- @[ -L "${REPODIR}/${PKG_ABI}/latest" ] && unlink ${REPODIR}/${PKG_ABI}/latest; \
- ${PKG_CMD} -o ABI=${PKG_ABI} repo -o OSVERSION="${SRCRELDATE}" \
+ @${PKG_CMD} -o ABI=${PKG_ABI} repo -o OSVERSION="${SRCRELDATE}" \
-m ${WSTAGEDIR}/meta \
-o ${REPODIR}/${PKG_ABI}/${PKG_VERSION} \
${REPODIR}/${PKG_ABI}/${PKG_VERSION} \
${PKG_REPO_SIGNING_KEY} ; \
cd ${REPODIR}/${PKG_ABI}; \
- ln -s ${PKG_OUTPUT_DIR} latest
+ ln -hfs ${PKG_OUTPUT_DIR} latest
#
#