From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 23EA1158064 for ; Thu, 9 May 2024 12:41:35 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7ECB0E2C4C; Thu, 9 May 2024 12:41:31 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 39DE9E2C48 for ; Thu, 9 May 2024 12:41:31 +0000 (UTC) Message-ID: <4af9b5f9bb582841841fbed75db1ef6fc3efa1df.camel@gentoo.org> Subject: Re: [gentoo-dev] [PATCH 3/4] acct-user.eclass: use an eclass variable for the override variable name From: =?UTF-8?Q?Micha=C5=82_G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Date: Thu, 09 May 2024 14:41:26 +0200 In-Reply-To: <33f53841c1b56606799ec88ca3738abb49498920.camel@gentoo.org> References: <20240509115745.5182-1-mjo@gentoo.org> <20240509115745.5182-4-mjo@gentoo.org> <33f53841c1b56606799ec88ca3738abb49498920.camel@gentoo.org> Organization: Gentoo Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-XrweesaU7I8/5MmgFqGr" User-Agent: Evolution 3.52.1 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 X-Archives-Salt: 2c43abb4-57b3-4d16-8a4f-c9aa3a79557c X-Archives-Hash: 1b6f0d68a6b9554d7f5579b0fcafec15 --=-XrweesaU7I8/5MmgFqGr Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 2024-05-09 at 08:12 -0400, Michael Orlitzky wrote: > On Thu, 2024-05-09 at 14:03 +0200, Micha=C5=82 G=C3=B3rny wrote: > > > @ECLASS_VARIABLE: _OVERRIDE_NAME > >=20 > > This is not prefixed correctly. > >=20 >=20 > ACCT_USER_OVERRIDE_NAME has an entirely different meaning, but I could > use _ACCT_USER_OVERRIDE_NAME if that's what you're suggesting. >=20 >=20 > > > +# @INTERNAL > > > +# @DESCRIPTION: > > > +# A version of the user name suitable for use in a bash variable. Th= is > > > +# is used to construct the names of the make.conf override variables= and > > > +# it will always be uppercase $PN with the hyphens replaced by > > > +# underscores. It is defined once, here, so that in an overlay the > > > +# ebuild may set ACCT_USER_NAME to something other than $PN without > > > +# affecting the name of the override variable. This is necessary if = the > > > +# username in question would lead to an invalid bash variable > > > +# name. Doing so does violate expectations with respect to the overr= ide > > > +# naming convention, but (a) your warranty is already void if you ar= e > > > +# changing ACCT_USER_NAME or using make.conf overrides, and (b) you > > > +# shouldn't need make.conf overrides in an overlay. > > > +_OVERRIDE_NAME=3D${ACCT_USER_NAME^^} > > > +_OVERRIDE_NAME=3D${_OVERRIDE_NAME//-/_} > >=20 > > Any reason not to just use PN directly below? After all, you need to > > sanitize it anyway. > >=20 >=20 > I started out with that, but I had to copy & paste the same comment > explaining why it uses $PN to each site. Then I had the idea to factor > it out. I don't really care though if you think it's preferable. >=20 I think it will be less confusing than trying to explain what _ACCT_USER_OVERRIDE_NAME is, and that it doesn't oveerride name. --=20 Best regards, Micha=C5=82 G=C3=B3rny --=-XrweesaU7I8/5MmgFqGr Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iQFGBAABCgAwFiEEx2qEUJQJjSjMiybFY5ra4jKeJA4FAmY8xHYSHG1nb3JueUBn ZW50b28ub3JnAAoJEGOa2uIyniQOi1oH/0wCW21cwtVD1DZB9qxI55IkEhJEqMhf N8wgKB/pmfPhC+CEQxXNCSnUvokKb+MTcx4lAvA+k5So2vCNmDZDRynAjY0jYfQ5 JGLDg3Ea5URdcICO4KNEaP4iABOl5il4i3UcwS+pzN0ZYUQA0/YvM9MxiEmFundW MEwZrBow///Vi6laJ9xK3w84bDLz7EYLrFwoXvvwT+HASDTtX8xXzPoWvnXICu7E N6QQPIf2yT2Qjb930fMk0+XvDrkvuBdhqTcWfEYvzH9CrZCIJxBWTOPWbzgINVC7 bdeRpgKbuD2k87+4HKhEcahMwbi+WynbWi1HBKrYVTAzRY7C37zuUZA= =Mzlg -----END PGP SIGNATURE----- --=-XrweesaU7I8/5MmgFqGr--