Date: Thu, 12 Mar 2026 01:38:53 +0000 From: Lexi Winter <ivy@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 2a3d650552fc - stable/15 - packages: Don't create empty packages Message-ID: <69b2192d.35f06.575528de@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/15 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=2a3d650552fc1a48c89e3d6d8e77f64ad53372ed commit 2a3d650552fc1a48c89e3d6d8e77f64ad53372ed Author: Lexi Winter <ivy@FreeBSD.org> AuthorDate: 2026-02-21 20:19:42 +0000 Commit: Lexi Winter <ivy@FreeBSD.org> CommitDate: 2026-03-12 01:38:01 +0000 packages: Don't create empty packages If a package plist only contains directories, but no files, do not create the package. This fixes an issue where setting "package=foo" in mtree causes the "foo" package to always be created, even if nothing else installs in that package, because the mtree entry is always added to the plist. This most often happens: * With architecture-specific directories, because mtree can't install a directory conditionally based on architecture, and * With packages that are completely empty when a particular src.conf knob is disabled, because mtree will still create the directories. Although it's theoretically possible that we might want to create a package that only contains directories, there are no such packages today. MFC after: 2 weeks (stable/15 only) Reviewed by: manu, des Differential Revision: https://reviews.freebsd.org/D55412 Sponsored by: https://www.patreon.com/bsdivy (cherry picked from commit 7965c93e4d4103ba6ed7ac1e5f1599c93cbcdbf7) --- Makefile.inc1 | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/Makefile.inc1 b/Makefile.inc1 index 0af5c38f0489..30d37e6bd2f5 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -2277,17 +2277,24 @@ create-world-packages-jobs: create-world-package-${pkgname} create-world-package-${pkgname}: .PHONY @sh ${SRCDIR}/release/packages/generate-ucl.sh -o ${pkgname} \ -s ${SRCDIR} -u ${WSTAGEDIR}/${pkgname}.ucl - @awk -F\" ' \ - /^name/ { printf("===> Creating %s-", $$2); next } \ - /^version/ { print $$2; next } \ - ' ${WSTAGEDIR}/${pkgname}.ucl - ${PKG_CMD} -o ABI=${PKG_ABI} -o ALLOW_BASE_SHLIBS=yes \ - -o OSVERSION="${SRCRELDATE}" \ - create -f ${PKG_FORMAT} ${PKG_CLEVEL} -T${PKG_CTHREADS} \ - -M ${WSTAGEDIR}/${pkgname}.ucl \ - -p ${WSTAGEDIR}/${pkgname}.plist \ - -r ${WSTAGEDIR} \ - -o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR} + @if [ "$$(grep -vc '^@dir' ${WSTAGEDIR}/${pkgname}.plist)" -gt 0 ]; then \ + awk -F\" ' \ + /^name/ { printf("===> Creating %s-", $$2); next } \ + /^version/ { print $$2; next } \ + ' ${WSTAGEDIR}/${pkgname}.ucl && \ + ${PKG_CMD} -o ABI=${PKG_ABI} -o ALLOW_BASE_SHLIBS=yes \ + -o OSVERSION="${SRCRELDATE}" \ + create -f ${PKG_FORMAT} ${PKG_CLEVEL} -T${PKG_CTHREADS} \ + -M ${WSTAGEDIR}/${pkgname}.ucl \ + -p ${WSTAGEDIR}/${pkgname}.plist \ + -r ${WSTAGEDIR} \ + -o ${REPODIR}/${PKG_ABI}/${PKG_OUTPUT_DIR}; \ + else \ + awk -F\" ' \ + /^name/ { printf("===> Skipping %s-", $$2); next } \ + /^version/ { print $$2; next } \ + ' ${WSTAGEDIR}/${pkgname}.ucl; \ + fi .endfor create-sets-packages-jobs: .PHONY create-sets-packageshome | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69b2192d.35f06.575528de>
