public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] [PATCH 3/4] acct-user.eclass: use an eclass variable for the override variable name
Date: Thu, 09 May 2024 14:41:26 +0200	[thread overview]
Message-ID: <4af9b5f9bb582841841fbed75db1ef6fc3efa1df.camel@gentoo.org> (raw)
In-Reply-To: <33f53841c1b56606799ec88ca3738abb49498920.camel@gentoo.org>

[-- Attachment #1: Type: text/plain, Size: 1825 bytes --]

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 #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 512 bytes --]

  reply	other threads:[~2024-05-09 12:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-09 11:57 [gentoo-dev] [PATCH 0/4] acct-{user,group}.eclass: make user/group names writable Michael Orlitzky
2024-05-09 11:57 ` [gentoo-dev] [PATCH 1/4] acct-user.eclass: make ACCT_USER_NAME writable Michael Orlitzky
2024-05-09 12:00   ` Michał Górny
2024-05-10  5:58     ` Ulrich Mueller
2024-05-09 11:57 ` [gentoo-dev] [PATCH 2/4] acct-group.eclass: make ACCT_GROUP_NAME writable Michael Orlitzky
2024-05-09 11:57 ` [gentoo-dev] [PATCH 3/4] acct-user.eclass: use an eclass variable for the override variable name Michael Orlitzky
2024-05-09 12:03   ` Michał Górny
2024-05-09 12:12     ` Michael Orlitzky
2024-05-09 12:41       ` Michał Górny [this message]
2024-05-09 11:57 ` [gentoo-dev] [PATCH 4/4] acct-group.eclass: " Michael Orlitzky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4af9b5f9bb582841841fbed75db1ef6fc3efa1df.camel@gentoo.org \
    --to=mgorny@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox