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 99FFE87D7; Mon, 29 Sep 2025 08:13:09 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id D23C38744; Mon, 29 Sep 2025 08:13:06 +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-b1-smtp.messagingengine.com (fout-b1-smtp.messagingengine.com [202.12.124.144]) by atuin.qyliss.net (Postfix) with ESMTPS id 881A48741 for ; Mon, 29 Sep 2025 08:13:05 +0000 (UTC) Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfout.stl.internal (Postfix) with ESMTP id 255921D0010A; Mon, 29 Sep 2025 04:13:04 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Mon, 29 Sep 2025 04:13:04 -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=fm1; t=1759133584; x=1759219984; bh=C2WbTRVSnu rvkQkbJanJ7n7mvVu1H1EsIwrjf+FY3o8=; b=MvvQiDPCsc6fu+Ug4zRxfORjOj awIRrGAXuQm7OZanzfYCqslY/boC55MMn1Bu555fC1cWMFF+PFUHZn3VFmHpemjn vgdhQP5yqZp96EEvfyQG1Bp48zsf29CexfvAulw9B96Nj7GKiQKmJWC2YB7nLOL3 wwtaTG1NZPmvJs8Nhn2yFXYotMubuPyDStrbo+FPLwwq0SHNDE5LCiHGQ35P/tTF wgbZX3sm7CrHCzEVrgelrAHYyyU2tI/tXRBA+eVhcXDjtwWyvANP+gcrmS4tVfOG BdFzkNJRMHPf56ozwRkgH/v7NkJLaAobhL3HGaxCWm31c0N3EA6RvT3cHRtg== 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=fm2; t= 1759133584; x=1759219984; bh=C2WbTRVSnurvkQkbJanJ7n7mvVu1H1EsIwr jf+FY3o8=; b=kyf2R1uo2zJbsLS6t0ucS8fnajkcc/09q3Xm8cxTtRcfSOoU+uY fg7lUchr7idI4lk7ZIumuuh9DHqHQmVQsLWlK/IyTraziEDpbl6DXWQ7CITm6IOm 6gm3Y+jS8K+q8jt7PXlNeuE+4F8wMd0y7H13ErFDj2EZZBij0+ubEkclbrmElZKJ 0/FP53sr3xYvTdfY+ZjxQAuEqgPNZ7rwlS8biDaPxHHr7KPcDUCfdpYlfxxsJZ/6 Vu9viMIwtq7/SCut23Z6WZwaidW2a9eke5t2W+nH3+nydNnyyRMZM6P9coeshtV3 Q9xRWcNiE35ikyTcY/iIdOJM10u5tiWYNmg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdejjeehtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefhvfevufgjfhffkfggtgesghdtreertddtjeenucfhrhhomheptehlhihsshgrucft ohhsshcuoehhihesrghlhihsshgrrdhisheqnecuggftrfgrthhtvghrnhepteehvedugf ejgfehhfeijeduleekleejgedvkeeuuefhhfegvdevfeetveegteeinecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhephhhisegrlhihshhsrgdrih hspdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegu vghmihhosggvnhhouhhrsehgmhgrihhlrdgtohhmpdhrtghpthhtohepuggvvhgvlhessh hpvggtthhruhhmqdhoshdrohhrgh X-ME-Proxy: Feedback-ID: i12284293:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 29 Sep 2025 04:13:03 -0400 (EDT) Received: by mbp.qyliss.net (Postfix, from userid 1000) id 240F626DFE69; Mon, 29 Sep 2025 10:13:02 +0200 (CEST) From: Alyssa Ross To: Demi Marie Obenour Subject: Re: [PATCH v6] Generate file lists from a script In-Reply-To: <20250927-genfiles-v6-1-2111a981596d@gmail.com> References: <20250926-genfiles-v5-1-3394dfb3b330@gmail.com> <20250927-genfiles-v6-1-2111a981596d@gmail.com> Date: Mon, 29 Sep 2025 10:12:59 +0200 Message-ID: <87ecrpd6d0.fsf@alyssa.is> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Message-ID-Hash: EQNV2X62PXCLKLVFBDDWCIGJZXID5R4T X-Message-ID-Hash: EQNV2X62PXCLKLVFBDDWCIGJZXID5R4T 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: > diff --git a/scripts/genfiles.awk b/scripts/genfiles.awk > new file mode 100644 > index 0000000000000000000000000000000000000000..986d86ec7e3080ab7c9a73307= d116d244ef542e0 > --- /dev/null > +++ b/scripts/genfiles.awk > @@ -0,0 +1,79 @@ > +# SPDX-License-Identifier: EUPL-1.2+ > +# SPDX-FileCopyrightText: 2025 Demi Marie Obenour > +BEGIN { > + RS =3D "\n"; > + FS =3D "\t"; > + modes["120000"] =3D "symlink"; > + modes["100644"] =3D "regular"; > + modes["100755"] =3D "regular"; > +} > + > +function fail(msg) { > + exit_code =3D 1; I've been pointing out since v3 that this variable doesn't do anything. It's still here! > + print msg > "/dev/stderr"; > + exit 1; > +} > + > +# Extract data from built-in variables. > +{ > + filename =3D $2; > + raw_mode =3D $1; > + # awk autocreates empty string entries if the key is invalid, > + # but the code exits in this case so that is okay. > + mode =3D modes[raw_mode]; > +} > + > +filename !~ /^[[:alnum:]_./-]+$/ { > + fail("filename '" filename "' has forbidden characters"); > +} > + > +# Skip license files > +/\.license$/ { next } > + > +filename ~ /^image\/etc\/s6-rc\// { > + if (mode !=3D "regular") { > + fail("s6-rc-compile input '" filename "' isn't a regular file"); > + } > + rc_files[rc_count++] =3D filename; > + next; > +} > + > +mode =3D=3D "symlink" { > + symlinks[symlink_count++] =3D filename; > + next; > +} > + > +mode =3D=3D "regular" { > + files[file_count++] =3D filename; > + next; > +} > + > +{ fail("File '" filename "' is not regular file or symlink (mode " raw_m= ode ")"); } > + > +END { > + if (exit_code) { > + exit exit_code; > + } > + printf ("# SPDX-License-Identifier: CC0-1.0\n" \ > +"# SPDX-FileCopyrightText: 2025 Demi Marie Obenour \n" \ Does reuse pick these up? If so, might need to break them up into multiple string literals. Let's leave a blank line after the header too =E2=80=94 I think that's more= readable. > +"FILES =3D"); > + for (array_index =3D 0; array_index < file_count; array_index +=3D 1) { > + printf " \\\n\t%s", files[array_index]; > + } > + # GNU Make uses the modification time of the *target* of a symlink, > + # rather than the modification time of the symlink itself. It can be t= old > + # to *also* use the symlink's modification time, but not to *only* use > + # the symlink's modification time. However, these symlinks will genera= lly > + # be broken, so make will not be able to dereference the symlink. > + # Therefore, using these symlinks as make dependencies won't work. > + printf ("\n\n" \ > +"LINKS =3D"); > + for (array_index =3D 0; array_index < symlink_count; array_index +=3D 1= ) { > + printf " \\\n\t%s", symlinks[array_index]; > + } > + printf "\n\nS6_RC_FILES =3D"; > + for (array_index =3D 0; array_index < rc_count; array_index +=3D 1) { > + printf " \\\n\t%s", rc_files[array_index]; > + } > + print ""; > +} > diff --git a/scripts/genfiles.sh b/scripts/genfiles.sh > new file mode 100755 > index 0000000000000000000000000000000000000000..a595d9effd64fe110ed0c2875= bbd30f4428ee3f7 > --- /dev/null > +++ b/scripts/genfiles.sh > @@ -0,0 +1,24 @@ > +#!/bin/sh -- > +set -euo pipefail Missing copyright. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRV/neXydHjZma5XLJbRZGEIw/wogUCaNo/jAAKCRBbRZGEIw/w og53AP9UQAC1OAS9Jrj+oINdkfP2xw+QYItCa00Yv2otuwN1dwEAyAUm0Yrj9vtq 1BYfJWUbEJiNxkUf+maB52eNuQA3lwU= =YmUe -----END PGP SIGNATURE----- --=-=-=--