Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Jul 2023 04:12:06 GMT
From:      Jessica Clarke <jrtc27@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 246364454fc1 - main - etcupdate: Use new buildetc and installetc targets when available
Message-ID:  <202307270412.36R4C646097744@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by jrtc27:

URL: https://cgit.FreeBSD.org/src/commit/?id=246364454fc13e80e33142764e276b395f308712

commit 246364454fc13e80e33142764e276b395f308712
Author:     Jessica Clarke <jrtc27@FreeBSD.org>
AuthorDate: 2023-07-27 04:10:49 +0000
Commit:     Jessica Clarke <jrtc27@FreeBSD.org>
CommitDate: 2023-07-27 04:10:49 +0000

    etcupdate: Use new buildetc and installetc targets when available
    
    These new targets avoid the need to invoke internal build system targets
    or set internal variables when building, and also have the added benefit
    of working with BUILD_WITH_STRICT_TMPPATH. Old source trees lacking such
    targets will not work with BUILD_WITH_STRICT_TMPPATH; they could be made
    to work by copying the steps, but it's not worth doing so, as they never
    have worked in the past. The primary goal of this is to support changing
    the default of BUILD_WITH_STRICT_TMPPATH to enabled.
    
    Reviewed by:    jhb
    Differential Revision:  https://reviews.freebsd.org/D41206
---
 usr.sbin/etcupdate/etcupdate.sh | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh
index ae75a6e36f03..4735fa6c75eb 100755
--- a/usr.sbin/etcupdate/etcupdate.sh
+++ b/usr.sbin/etcupdate/etcupdate.sh
@@ -219,11 +219,19 @@ build_tree()
 			cd $SRCDIR || exit 1;
 			if ! [ -n "$nobuild" ]; then
 				export MAKEOBJDIRPREFIX=$destdir/usr/obj;
-				$make _obj SUBDIR_OVERRIDE=etc || exit 1
-				$make everything SUBDIR_OVERRIDE=etc || exit 1
+				if [ -n "$($make -V.ALLTARGETS:Mbuildetc)" ]; then
+					$make buildetc || exit 1
+				else
+					$make _obj SUBDIR_OVERRIDE=etc || exit 1
+					$make everything SUBDIR_OVERRIDE=etc || exit 1
+				fi
+			fi
+			if [ -n "$($make -V.ALLTARGETS:Minstalletc)" ]; then
+				$make DESTDIR=$destdir installetc || exit 1
+			else
+				$make DESTDIR=$destdir distrib-dirs || exit 1
+				$make DESTDIR=$destdir distribution || exit 1
 			fi
-			$make DESTDIR=$destdir distrib-dirs || exit 1
-			$make DESTDIR=$destdir distribution || exit 1
 		) || return 1
 	fi
 	chflags -R noschg $1 || return 1



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202307270412.36R4C646097744>