From nobody Mon Oct 03 16:17:00 2022 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 4Mh5ZN5rrMz4d6cs; Mon, 3 Oct 2022 16:17:00 +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 4Mh5ZN5K0Jz3Msj; Mon, 3 Oct 2022 16:17:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664813820; 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=GI3yUJd+pshedkoRdmzgrvGtbKI4fMrFEmf2KfyyxPE=; b=KMCKcYG5BjBACuF2Vx3ti2XZ3n9EQbUe/0qUEb9BRwmSys5mCXMRMAWIfYaY6b8AdkUMgP /1cVilPcEgQUrw84w/SH3MFZliREtfcmTTD+2VCQV6rcubUqNUpFTp9uv5RNF78j1ypLsq BOcLMkKeSnTlcAPAOr9rKH/68B6cfneO2s62X4Xy3P8LRlThu23XLTwgnM39ywHq+DvJ2s Tx3aTnxOZGpGZ50+RG4ZS26E1lIfA3kraHIk/BXvfLI9njk/nkcaGLQr8YWsuXEADwQBKS wb5FxFNjZvR1CneQtrAcm7ArrNYke5GsufiLxJL+VDA48IQpqpfUvO0SFrlSnw== 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 4Mh5ZN4KrjzGKl; Mon, 3 Oct 2022 16:17:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 293GH0BP035705; Mon, 3 Oct 2022 16:17:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 293GH023035704; Mon, 3 Oct 2022 16:17:00 GMT (envelope-from git) Date: Mon, 3 Oct 2022 16:17:00 GMT Message-Id: <202210031617.293GH023035704@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: e571b0f8f8c1 - main - etcupdate: Fix -N support for build command 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: e571b0f8f8c1730330fb656d54f081beb993c962 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664813820; 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=GI3yUJd+pshedkoRdmzgrvGtbKI4fMrFEmf2KfyyxPE=; b=oEs0P2y9cD/G4eMceJZXDcwWJuPccQobWkFFEQ86DSYi/DGmsXy3P0sOnH1vmjbLTEqmTB LVXtcLFrJ3BWkQG5CZRA2neGOHGQUge601s81tWoxgV7HRNcjKVE1tzk9/oqPFtbeid0XR 99ZigEzg3R2775+QqbqCZsTeqmIEtwUWWT4NUui8l5HERb5xmTbAkL26BweRy+2xE9AUOE ygrGkydIlKFUcbDsX0Jq0LDd4HvuYT2PGth+DTYv438nJKZz5uOZmXngd/Rkg8NV0CqFAq Mx6CNC0xHchnRxhIKyy3fOq8JIzGOHRSfqnw20YGr2dk2fT+Vx3cnmgAhq5mPQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1664813820; a=rsa-sha256; cv=none; b=U4pcZuJtgnBq3zGB8JwIP0YCjJaaQGyA+z2rJj/D5mhFPfoWKJd5Uq0/8GMxpgFc0+SJBo OmEmOIBzwJnla0mOhTashCCLSRx+zwAU0vA6ikT787IEaxOS67mYJQxGbXfGyGhLhUqwCt zcFRQX2Fzl5slMZUvVzlqXSI1P9MlEx6+4os6QGYRrKR4JpxzX4hQZ9u5k9FWqOLyQTvkA 35BHaoq9qQlDxgt4o8Ntver90s2vbGPFiLRYGCT6m2O/CdsQ1bZ71F4rm6LKQnBB730/81 XSn7NBuIDUIPJzCw5NUmKKgKWR3aX5Yl4DclQlnfpYIAktQ0ShjNJIqKbv6RCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=e571b0f8f8c1730330fb656d54f081beb993c962 commit e571b0f8f8c1730330fb656d54f081beb993c962 Author: Jessica Clarke AuthorDate: 2022-10-03 16:16:19 +0000 Commit: Jessica Clarke CommitDate: 2022-10-03 16:16:19 +0000 etcupdate: Fix -N support for build command Whilst febca0e64361 added -N for both build and extract, it only fully worked for extract; build would perform the actual tree build with -DNO_ROOT and construct the intended METALOG, but the subsequent tarball creation did not take this into account and just tarred up the the directory as-is rather than using the METALOG. This resulted in the permissions and ownership not being correct, as well as there being a stray METALOG file in the tarball's root. Reported by: avg Reviewed by: avg, jhb, imp Tested by: avg Fixes: febca0e64361 ("etcupdate: Add a -N flag to perform a NO_ROOT build") Differential Revision: https://reviews.freebsd.org/D36845 --- usr.sbin/etcupdate/etcupdate.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/usr.sbin/etcupdate/etcupdate.sh b/usr.sbin/etcupdate/etcupdate.sh index 0190e5868f05..445b8e105c61 100755 --- a/usr.sbin/etcupdate/etcupdate.sh +++ b/usr.sbin/etcupdate/etcupdate.sh @@ -1321,7 +1321,7 @@ handle_added_file() # Build a new tree and save it in a tarball. build_cmd() { - local dir + local dir tartree if [ $# -ne 1 ]; then echo "Missing required tarball." @@ -1342,7 +1342,12 @@ build_cmd() remove_tree $dir exit 1 fi - if ! tar cfj $1 -C $dir . >&3 2>&1; then + if [ -n "$noroot" ]; then + tartree=@METALOG + else + tartree=. + fi + if ! tar cfj $1 -C $dir $tartree >&3 2>&1; then echo "Failed to create tarball." remove_tree $dir exit 1