From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id 16F852156D; Fri, 19 Sep 2025 16:48:00 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id 9F3752154A; Fri, 19 Sep 2025 16:47:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_MISSING,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=4.0.1 Received: from fout-b3-smtp.messagingengine.com (fout-b3-smtp.messagingengine.com [202.12.124.146]) by atuin.qyliss.net (Postfix) with ESMTPS id C416621547 for ; Fri, 19 Sep 2025 16:47:54 +0000 (UTC) Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfout.stl.internal (Postfix) with ESMTP id 02CA71D00100; Fri, 19 Sep 2025 12:47:52 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Fri, 19 Sep 2025 12:47:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1758300472; x=1758386872; bh=kLl1+DgVRb Lld30Fjb5J6x1uldbLHNxmIxaNb0adyn8=; b=Ch6+h5G4/BcOp7s/mbo/0bGqXY Q1hWnOCPJzcumcaG65821qF3G6TdW6C6XLdyKeGSw9d1vQ9lnroQV7BynXdidbtV 1rWXU51+Vwzh7Rqs3wyH3y7hM8Z7ao6KSEQU4x2cWYGF08KKQO9gZQy7jE9ueSkP FsTdbbTKdzUHZD0d5iSBE3Dfz5AblDiMPqsrZf/QjJnR3kThJpz8p40ThRgeNl1u C12j49Y18DXRi2hYGJyNY2QLFf3bVGfxtC/vy6S11vTOxmNaLRZHD3Ju78kYiI2W g2MlyNGyJewRJOLSnlWvIFtrR+zmB4PdLDnFjPEh3XjxSXRaLhcJGBZBvE9Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1758300472; x=1758386872; bh=kLl1+DgVRbLld30Fjb5J6x1uldbLHNxmIxa Nb0adyn8=; b=KpXMTulBgTZbUqUOmsUYwtdTDuvmmQ3qdXLPOBixDE614RgXFKz N5dbrZi3mJPBd3IjeU9e5vrTCTfUV1s2SMcJZWNVxegSBomJdGZmGL0a4C/uc7sp LVttBpgLruP30CfbLy5U/n5b0wNuL06YscJCvKUfNTnODsowOK0aBnLU8L+RKOoY c15Sd8S/1iRte2Gy0pLL7UhV00bcdlMLxYKRCPHsH3l1wKok+7J3eoM3Nyg+cZ8s BXKrzLLitVAOV4XJ8GfmjKN+c4VCfmOwf++W75M7uPlIiiXn4nr4D+xpdyUTvuZi d0WEQSMes+y/tSiQvBNwQKDh6uQ4XTTrYfQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdegleejfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefhvfevufgjfhffkfggtgesghdtreertddtjeenucfhrhhomheptehlhihsshgrucft ohhsshcuoehhihesrghlhihsshgrrdhisheqnecuggftrfgrthhtvghrnhepteehvedugf ejgfehhfeijeduleekleejgedvkeeuuefhhfegvdevfeetveegteeinecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhephhhisegrlhihshhsrgdrih hspdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegu vghmihhosggvnhhouhhrsehgmhgrihhlrdgtohhmpdhrtghpthhtohepuggvvhgvlhessh hpvggtthhruhhmqdhoshdrohhrgh X-ME-Proxy: Feedback-ID: i12284293:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 19 Sep 2025 12:47:52 -0400 (EDT) Received: by mbp.qyliss.net (Postfix, from userid 1000) id F2B111FD47EF; Fri, 19 Sep 2025 18:47:50 +0200 (CEST) From: Alyssa Ross To: Demi Marie Obenour Subject: Re: [PATCH 05/20] scripts/make-erofs.sh: Avoid unneeded calls to dirname In-Reply-To: <20250904-systemd-v1-5-2a63b790a913@gmail.com> References: <20250904-systemd-v1-0-2a63b790a913@gmail.com> <20250904-systemd-v1-5-2a63b790a913@gmail.com> Date: Fri, 19 Sep 2025 18:47:50 +0200 Message-ID: <87bjn6s821.fsf@alyssa.is> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Message-ID-Hash: QLWSZKU73RRQSAMNM3KRF45DBCYGAJII X-Message-ID-Hash: QLWSZKU73RRQSAMNM3KRF45DBCYGAJII X-MailFrom: hi@alyssa.is X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-devel.spectrum-os.org-0; header-match-devel.spectrum-os.org-1; header-match-devel.spectrum-os.org-2; header-match-devel.spectrum-os.org-3; header-match-devel.spectrum-os.org-4; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Spectrum OS Development X-Mailman-Version: 3.3.9 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Demi Marie Obenour writes: > Use builtin string manipulation instead. > > Signed-off-by: Demi Marie Obenour > --- > scripts/make-erofs.sh | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > > diff --git a/scripts/make-erofs.sh b/scripts/make-erofs.sh > index cf942972910c76e1835dc5b0084c2d04bf084a9d..93cb3245f409b24c24be05e93= 07a1b2e12c867fe 100755 > --- a/scripts/make-erofs.sh > +++ b/scripts/make-erofs.sh > @@ -78,7 +78,19 @@ while read -r arg1; do >=20=20 > check_path "$arg1" "$arg2" >=20=20 > - parent=3D$(dirname "$arg2") > + # The below simple version of dirname(1) can only handle > + # a subset of all paths, but this subset includes all of > + # the paths that check_path doesn't reject. Are any of the paths it would mishandle paths that would actually be likely to show up? I feel like we don't really need to worry about people putting silly things in the Makefile, especially since that's going to be generated going forward, and in the case of Nix store paths we know those will always be the store directory, a slash, and then a single component. I don't really want to be overly defensive, especially since we're not in other places in the build system =E2=80=94 as= a consequence of using make, which doesn't handle spaces well, for example. > + case $arg2 in > + (*/*) > + # Create the parent directory if it doesn't already > + # exist. > + parent=3D${arg2%/*} > + ;; > + (*) > + parent=3D. > + ;; > + esac > mkdir -p -- "$root/$parent" > cp -RT -- "$arg1" "$root/$arg2" > done > > --=20 > 2.51.0 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRV/neXydHjZma5XLJbRZGEIw/wogUCaM2JNgAKCRBbRZGEIw/w oncLAP4o8hervl1pu2P5yEzuRJl92WoTUVjWkyM6IuYMrqeERwD6AjOJL4MNTGM4 waobduT3SwX439O4R1JV4u0OyF0RvAU= =6QnD -----END PGP SIGNATURE----- --=-=-=--