git: 42143eb1767a - stable/15 - pkgbase: Don't include pkg by default

From: Colin Percival <cperciva_at_FreeBSD.org>
Date: Sat, 20 Sep 2025 23:28:06 UTC
The branch stable/15 has been updated by cperciva:

URL: https://cgit.FreeBSD.org/src/commit/?id=42143eb1767afc3e6114bcc352f3815c03044dc2

commit 42143eb1767afc3e6114bcc352f3815c03044dc2
Author:     Colin Percival <cperciva@FreeBSD.org>
AuthorDate: 2025-09-19 16:20:37 +0000
Commit:     Colin Percival <cperciva@FreeBSD.org>
CommitDate: 2025-09-20 13:50:56 +0000

    pkgbase: Don't include pkg by default
    
    We need to put pkg into the pkgbase repository for release builds, but
    not for non-release pkgbase builds.  Gate the contents of package-pkg
    behind INCLUDE_PKG_IN_PKGBASE_REPO=YES and set that when building
    releases.
    
    Reviewed by:    ivy
    MFC after:      6 hours
    Sponsored by:   https://www.patreon.com/cperciva
    
    (cherry picked from commit 060f7edadcff77cf804b60ecb25f8517c8dca62f)
---
 Makefile.inc1    | 2 ++
 release/Makefile | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/Makefile.inc1 b/Makefile.inc1
index d41741d15384..65149beb9eb6 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -2047,6 +2047,7 @@ update-packages: .PHONY
 	${_+_}${MAKE} -C ${.CURDIR} ${PKGMAKEARGS} real-update-packages
 
 package-pkg: _pkgbootstrap _repodir .PHONY
+.if defined(INCLUDE_PKG_IN_PKGBASE_REPO)
 .if exists(${PORTSDIR})
 	rm -rf /tmp/ports.${TARGET} || :
 	env ${WMAKEENV} SRCDIR=${.CURDIR} PORTSDIR=${PORTSDIR} REVISION=${_REVISION} \
@@ -2055,6 +2056,7 @@ package-pkg: _pkgbootstrap _repodir .PHONY
 		OSVERSION="${SRCRELDATE}" \
 		sh ${.CURDIR}/release/scripts/make-pkg-package.sh
 .endif
+.endif
 
 real-packages:	stage-packages create-packages sign-packages .PHONY
 
diff --git a/release/Makefile b/release/Makefile
index 50f69565a638..3d1e2d44e4a8 100644
--- a/release/Makefile
+++ b/release/Makefile
@@ -195,7 +195,8 @@ PKG_ABI=	$$(${PKG_CMD} -o ABI_FILE=${.TARGET}/usr/bin/uname config ABI)
 
 pkgbase-repo:
 	mkdir -p pkgbase-repo
-	( ${IMAKE} -C ${WORLDDIR} packages REPODIR=${.OBJDIR}/pkgbase-repo )
+	( ${IMAKE} -C ${WORLDDIR} packages REPODIR=${.OBJDIR}/pkgbase-repo \
+	    INCLUDE_PKG_IN_PKGBASE_REPO=YES )
 
 disc1: ${PKGBASE_REPO}
 # Install system