From nobody Fri Oct 3 20:15:34 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4cdfzp4Cyxz696Jm; Fri, 03 Oct 2025 20:15:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cdfzp3dSsz3tTF; Fri, 03 Oct 2025 20:15:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759522534; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kHzS1ABHOeskNDeOdi2PZdNjecjDeW7MylDkCEIDFBE=; b=vAfSCIitriH6TZr3KsLcRQTuGJ2pDVE4f6Bj9dm6ivufCBmbLpUFvf6KusodxRPf5EkJp+ FqF6xXiBjYacrYUdtNBG+uHG5j++/gMiK9bhCGXFu2Od4iky+6IdhnchTFwmWFwwLV6Pcl 191o3V+0VCePpfPmmzT37yYOpvDOa++rsO5IlKZGX02rA5W2BWDD10Mz6gKBSTLEWYDHx2 k1GWwgbqTNLkYhZie8PBWavfw/PxBWKW4MxWIQ9zo3utqUu0Hb0nTW+EyQ31mWeDpxYciT OSQNL+Opcqst88RvPFx7cwzVcNrUDfh8II6eHH6Zp46FIhq1lbXDGYuMaBPMeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759522534; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=kHzS1ABHOeskNDeOdi2PZdNjecjDeW7MylDkCEIDFBE=; b=tdWz0Lw98OR1PNvTTPRq88V2ffeHXK2gaCU+K1GX71XFTSBBJaBrlW1eASngytn1ZykI9L NciFxBRz5nu54ZvEiJgIjifJ4/5RZwzyxKsbeosrQY+6Y51iZVumAp0jxsCefx8+S3QG5T 6pIKAVpxADh4KxsusVD3oqTgDHTXZjbr/3RTcSN1yGwjBuqh2/oLxdGhnbQ2QGpspuwwGM paMpqNIxa0ztcvzDiwtvrF6p+GcOy1NRU+CID4ruP06A9GrSggAh1IlmsqLQiIiSN4RVQ0 rYpSGXdn++s44i46ue/o9cgwe/JKrELeFGtknsvAKKLJKAeYsWU4Y49z90o9NQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759522534; a=rsa-sha256; cv=none; b=MSGIgStGicskzFzA+BOxbJy/Jd3RReoyzwKLcfwlaRA1j/0V9Ft4PoKnZUuwyelKjzpEaS BG5NyAkwsw8w+8sFIqiq+KEpUvsZb5RZ1CIsHDsmqNJpSxZYyoWnuUF1CI+2+0WXmtLR/f FjbI5fI3Gi3NU3T+0zCVKzL+vxK3W0T3JFD0I6C6iU5AiBwxyvFISVPFufHXIiD3gn72PY 1XhwJUiKc8a0AO6Vl55hJRoYHW93eZnf+ELs/2wnUXjv2GQBi/TTFRi5+He5D5Iwi2aF7Q RlipmXooHFoUAOkE8c9sbPkHNlCtXOx2bURroPZ5IRPBGVrYosMvXLTlxXXwJQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4cdfzp3D4Lz18h5; Fri, 03 Oct 2025 20:15:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 593KFYkm042748; Fri, 3 Oct 2025 20:15:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 593KFYot042745; Fri, 3 Oct 2025 20:15:34 GMT (envelope-from git) Date: Fri, 3 Oct 2025 20:15:34 GMT Message-Id: <202510032015.593KFYot042745@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Lexi Winter Subject: git: f4f0b7c34027 - stable/15 - etc, ypserv: Fix symlink creation for pkgbase List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ivy X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: f4f0b7c34027378a117d581aba7151b982b1defa Auto-Submitted: auto-generated The branch stable/15 has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=f4f0b7c34027378a117d581aba7151b982b1defa commit f4f0b7c34027378a117d581aba7151b982b1defa Author: Lexi Winter AuthorDate: 2025-10-02 01:10:28 +0000 Commit: Lexi Winter CommitDate: 2025-10-03 19:21:38 +0000 etc, ypserv: Fix symlink creation for pkgbase The Makefile logic for /etc/aliases, /var/yp/Makefile and /etc/unbound tries to avoid creating the symlink if it already exists in the target, but this breaks with pkgbase since the symlink won't be installed (and therefore won't be added to METALOG) if building with an existing worldstage, meaning it's missing from the generated package. Change the logic to forcibly install the symlink if NO_ROOT is defined, but keep the existing logic for non-package builds to avoid trashing the user's custom symlinks on non-pkgbase installworld. MFC after: 3 seconds Reported by: cperciva Reviewed by: cperciva, emaste Sponsored by: https://www.patreon.com/bsdivy Differential Revision: https://reviews.freebsd.org/D52834 (cherry picked from commit 09cd3decf0fae4b769b04c1e900ed5935c40957e) --- etc/Makefile | 23 +++++++++++++++-------- usr.sbin/ypserv/Makefile | 5 ++++- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/etc/Makefile b/etc/Makefile index ab799b2f6c80..93d4b489ec7d 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -64,9 +64,12 @@ distribution: ${INSTALL_SYMLINK} -T "package=runtime" ../var/run/os-release \ ${DESTDIR}/etc/os-release .if ${MK_UNBOUND} != "no" - if [ ! -e ${DESTDIR}/etc/unbound ]; then \ - ${INSTALL_SYMLINK} -T "package=unbound" \ - ../var/unbound ${DESTDIR}/etc/unbound; \ +# If NO_ROOT is defined, we are doing a stage install and always need to +# install the /etc/unbound symlink, otherwise, don't overwrite the user's +# existing symlink. + if [ "${NO_ROOT:Dtrue}" = true -o ! -e ${DESTDIR}/etc/unbound ]; then \ + ${INSTALL_SYMLINK} -Tpackage=unbound ../var/unbound \ + ${DESTDIR}/etc/unbound; \ fi .endif .if ${MK_SENDMAIL} != "no" @@ -82,12 +85,16 @@ distribution: .if ${MK_MAIL} != "no" cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ -T "package=runtime,config" ${ETCMAIL} ${DESTDIR}/etc/mail - if [ -d ${DESTDIR}/etc/mail -a -f ${DESTDIR}/etc/mail/aliases -a \ - ! -f ${DESTDIR}/etc/aliases ]; then \ - ${INSTALL_SYMLINK} -T "package=runtime" \ - mail/aliases ${DESTDIR}/etc/aliases; \ +# If NO_ROOT is defined, we are doing a stage install and always need to +# install the /etc/aliases symlink, otherwise, don't overwrite the user's +# existing symlink. + if [ "${NO_ROOT:Dtrue}" = true -o \( -f ${DESTDIR}/etc/mail/aliases -a \ + ! -f ${DESTDIR}/etc/aliases \) ]; then \ + ${INSTALL_SYMLINK} -Tpackage=runtime mail/aliases \ + ${DESTDIR}/etc/aliases; \ fi -.endif +.endif # ${MK_MAIL} != "no" + .if ${MK_SENDMAIL} != "no" cd ${.CURDIR}/mail; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 644 \ -T "package=sendmail" ${ETCMAIL_SENDMAIL} ${DESTDIR}/etc/mail diff --git a/usr.sbin/ypserv/Makefile b/usr.sbin/ypserv/Makefile index ba7eb1f86267..b4e59b719692 100644 --- a/usr.sbin/ypserv/Makefile +++ b/usr.sbin/ypserv/Makefile @@ -41,7 +41,10 @@ FILESNAME= Makefile.dist FILESDIR= /var/yp SCRIPTS= ypinit.sh -.if !exists(${DESTDIR}${FILESDIR}/Makefile) +# If NO_ROOT is defined, we are doing a stage install and always need to +# install the symlink, otherwise, don't overwrite the user's existing +# symlink. +.if defined(NO_ROOT) || !exists(${DESTDIR}${FILESDIR}/Makefile) SYMLINKS= ${FILESNAME} ${FILESDIR}/Makefile .endif