From nobody Thu Oct 2 01:37:54 2025 X-Original-To: dev-commits-src-main@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 4ccZDf6r3Wz69rln; Thu, 02 Oct 2025 01:37:54 +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 4ccZDf5w49z3d8l; Thu, 02 Oct 2025 01:37:54 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759369074; 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=ZDq5VYw3SokQ6vYwlvgFnHU2JoRgQiYELYTMFaQMhqc=; b=R79185g+5pbQCSB8+h8T9k/Pv9dCprBHp4c+BeSso5rjGaPkJ4LWi4sRKMlrYa0TYJgl2Q 2MX5Z/rwvvh2nobZg03twzN/s7EeFIBSqgMzyISyKuEoGE5HWrKhf1TLFaeZG3FhgdzsEf BkNZ6xsYP9F6wr77XbdxVPZ5CmUziWrMxoyXhhgvXy9aL5vxBcWFOa+vBCMuLtPJungOvB pcvwIr22bBP9uk9/OpP5klxJ9celZ+OItFsuVemB3uNW4vR7mGudJMn9GWFnF8xy6/j6Kf 9C8tJxy0jJtTtZDuQzwo3N1ATBU6i2J/t9wcxI78NBrWnOletPjgrl5KKEh/og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759369074; 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=ZDq5VYw3SokQ6vYwlvgFnHU2JoRgQiYELYTMFaQMhqc=; b=b04EEVtddFcktGOZW2nmdEBGw8f69cGpGPS8V0Kt03Pg4z8hb7M/AwT4hwdhX6oQZ8opKV YZHmmqbvQ3sgApuosdy9YgvoPUKvMC7cLmrxKvxPPn7KKir3FixXwAbKrS5VYhcExygs2e h+J+F57hM452ZYD3k6Vo8OBlqmexdWSFrKDkvDgRDO/dgdEi6efWtE3dQTGL+ISVi2Uqr+ gMq1HXVnJ9R6172sOr7l0+2ZIKpPnG8QNpqmbG+OJkjfLG7t/p8pVCA93l3k1rplz8TQpv nQEHFhkYSXB4Lwh5qwDlrIcNlerkDowYaq0PxemuCqZy2ts0ArMvE0se94fROA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759369074; a=rsa-sha256; cv=none; b=GlohRR1G2wVdcAlYQn/1j7kTSxxlfYVqFJw3TxneueEFBXI1glpbk020fHAhv7gWNJcbRX LzidTAH80djjt0c2EyK7h4dOhD6q7WAvHpBTEmmpVlJbBD8aVixEi9a7TimLbLYwB6RD1D 8sUFawfvH/BiOQnIp8MpHV8ml7o/+cH5X/5g6kIfXjY8WLX82otsTkvzxu/LNto4HLCn71 D/OT+pRnZI4ttEbZ6/bAKmpPrOL199xU6pecNGggPBnu31igIB4P7m0NsJxZrH/L/StxWU iHXGjkl/jm7qnBffIgmUsP7LfQP9R0cd/kFuMM9ZidbWorO65YkGgRNkTjTsmA== 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 4ccZDf5FPMznBS; Thu, 02 Oct 2025 01:37:54 +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 5921bso8035607; Thu, 2 Oct 2025 01:37:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5921bsx1035605; Thu, 2 Oct 2025 01:37:54 GMT (envelope-from git) Date: Thu, 2 Oct 2025 01:37:54 GMT Message-Id: <202510020137.5921bsx1035605@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: 09cd3decf0fa - main - etc, ypserv: Fix symlink creation for pkgbase List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 09cd3decf0fae4b769b04c1e900ed5935c40957e Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=09cd3decf0fae4b769b04c1e900ed5935c40957e commit 09cd3decf0fae4b769b04c1e900ed5935c40957e Author: Lexi Winter AuthorDate: 2025-10-02 01:10:28 +0000 Commit: Lexi Winter CommitDate: 2025-10-02 01:37:35 +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 --- 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