On Thu, 2024-05-09 at 08:12 -0400, Michael Orlitzky wrote:
> On Thu, 2024-05-09 at 14:03 +0200, Michał Górny wrote:
> > >  @ECLASS_VARIABLE: _OVERRIDE_NAME
> > 
> > This is not prefixed correctly.
> > 
> 
> ACCT_USER_OVERRIDE_NAME has an entirely different meaning, but I could
> use _ACCT_USER_OVERRIDE_NAME if that's what you're suggesting.
> 
> 
> > > +# @INTERNAL
> > > +# @DESCRIPTION:
> > > +# A version of the user name suitable for use in a bash variable. This
> > > +# 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 override
> > > +# naming convention, but (a) your warranty is already void if you are
> > > +# changing ACCT_USER_NAME or using make.conf overrides, and (b) you
> > > +# shouldn't need make.conf overrides in an overlay.
> > > +_OVERRIDE_NAME=${ACCT_USER_NAME^^}
> > > +_OVERRIDE_NAME=${_OVERRIDE_NAME//-/_}
> > 
> > Any reason not to just use PN directly below?  After all, you need to
> > sanitize it anyway.
> > 
> 
> 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.
> 

I think it will be less confusing than trying to explain what
_ACCT_USER_OVERRIDE_NAME is, and that it doesn't oveerride name.

-- 
Best regards,
Michał Górny

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to