From nobody Thu Jul 27 04:12:04 2023 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 4RBHQr64p9z4pQRk; Thu, 27 Jul 2023 04:12:04 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RBHQr4ygTz3nf6; Thu, 27 Jul 2023 04:12:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690431124; 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=nVWLbIMCRlzB2cj9C/eVlDLw0BrdOkTlGaVejwZWVdk=; b=rInEePLhiHFOs+/zPbm2oYs4o88OPCLH7wbsHll4Q+VtsiVX99RRWj7zLG3cDwIBxYYgrZ BnVEPXjD+jNCOOGmxKA+wIwb1NPwVFEvlS/FErUg2N5trWwwikb1dTMt0uUlddr6ENlWvE hGfmh9VM+lmYkXGEcySNA7OqNp3s29JoI0Id+eDEPHgRV5xr9grdKKAYmUhWFHILn+CBXI 4hrCGOe+434emYN5bF/+uXLu/ukypj7N8pDIN7gSt0jeXgaXW1UJ5kuKb8L+4jDtbOPvu9 MWa+UXEd+/03kfqvhBaum1baRlUj8IVApJAsF12NllRwYI4+wLHIgyTFMRxB9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1690431124; 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=nVWLbIMCRlzB2cj9C/eVlDLw0BrdOkTlGaVejwZWVdk=; b=Ke3opzuNlW48phC3aZx8uJHzQYa0irapFoZ8+Ct42o6mP76fSJPy/nGpNjliCPs4RViNrP XsEtuvXslvCz9A3+J5/MSg7PbIqw4YKjzZG8voCRcDw6aTb8vqwUwe/EVkVy3D3kjwbhgk vLEP31dKwt1xMPF2LEH80O7z13nTBBX1jx1qKNwv3+MJx3luUbC7ZKOOb3ieAaONIUq8Bl d1+farZsGVqxAqZAK8LVra5Pc7FaTxYQO2XQCV6L2A/vRVJYEDStFAqqn39K8EMLcN1bv6 85hLmi3EZihsYCcle0aM/2IhxgHs4haI4bkU3JXwBjhvnMgWnBVjtxhU6VichA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1690431124; a=rsa-sha256; cv=none; b=cdLMMGsDY03shWMkeAjnR3FCAnD1kG/ofTjVPSSE2c52t8hYSqyELw/Z6qqac+/ntshjhP I0EgDClpeX0MBUreFPg85ZCbvIf0RiVpcPLT9WxpduezbEGmQju0JvIhBvrFEWFh4DAnFe 1IFdT9hZDw1Ap6DxfxiSEawHnhGnpp2LJ1DCdE4eymHYA91H3Wr5kCyfyZ2J9fZwoy96gN vkkAoau6IJmxwtL4yHs6z0KInZvESx6YK4dI+dnxIQTMwNRU6tXKO1xAj2V94h1icWk+wg 7zIsMgVQPVzn6oCIMsXSq1Hj62uxbktgvi8br8e0Ll7g7kHdPhyLlkXHjZfVWA== 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 4RBHQr3Ktgz19Dd; Thu, 27 Jul 2023 04:12:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 36R4C4TX097703; Thu, 27 Jul 2023 04:12:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 36R4C4f2097702; Thu, 27 Jul 2023 04:12:04 GMT (envelope-from git) Date: Thu, 27 Jul 2023 04:12:04 GMT Message-Id: <202307270412.36R4C4f2097702@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 03e62670c33c - main - etcupdate: Consolidate nobuild cases and make more robust 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 03e62670c33c5d68ea69c842c24fe86765e2639e Auto-Submitted: auto-generated The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=03e62670c33c5d68ea69c842c24fe86765e2639e commit 03e62670c33c5d68ea69c842c24fe86765e2639e Author: Jessica Clarke AuthorDate: 2023-07-27 04:10:48 +0000 Commit: Jessica Clarke CommitDate: 2023-07-27 04:10:48 +0000 etcupdate: Consolidate nobuild cases and make more robust The distrib-dirs and distribution steps are shared between the two, the only difference is whether MAKEOBJDIRPREFIX is in the environment for the latter. Having in the environment for the former is currently not needed but does no harm and will be needed in future, so we can just export it up-front in the subshell. When we do distrib-dirs relative to _obj and everything also doesn't matter, so move it next to distribution where it makes more sense. Finally, to avoid complicated && chains, use "|| exit 1" everywhere to make the subshell fail, and add an extra one on to the cd $SRCDIR to handle that failing (otherwise we'd go on and try to build the current directory after cd prints its error, which is unhelpful). These changes will make it easier to bundle these steps up into new top-level targets to allow the build system to manage the steps rather than etcupdate, which will also handle BUILD_WITH_STRICT_TMPPATH, which currently does not work with etcupdate. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D41204 --- usr.sbin/etcupdate/etcupdate.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh index d15d1498200f..ae75a6e36f03 100755 --- a/usr.sbin/etcupdate/etcupdate.sh +++ b/usr.sbin/etcupdate/etcupdate.sh @@ -214,15 +214,17 @@ build_tree() mkdir -p $1/etc || return 1 cp -p $SRCDIR/$file $1/etc/$name || return 1 done - elif ! [ -n "$nobuild" ]; then - (cd $SRCDIR; $make DESTDIR=$destdir distrib-dirs && - MAKEOBJDIRPREFIX=$destdir/usr/obj $make _obj SUBDIR_OVERRIDE=etc && - MAKEOBJDIRPREFIX=$destdir/usr/obj $make everything SUBDIR_OVERRIDE=etc && - MAKEOBJDIRPREFIX=$destdir/usr/obj $make DESTDIR=$destdir distribution) || \ - return 1 else - (cd $SRCDIR; $make DESTDIR=$destdir distrib-dirs && - $make DESTDIR=$destdir distribution) || return 1 + ( + 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 + fi + $make DESTDIR=$destdir distrib-dirs || exit 1 + $make DESTDIR=$destdir distribution || exit 1 + ) || return 1 fi chflags -R noschg $1 || return 1 rm -rf $1/usr/obj || return 1