Re: [gentoo-dev] [PATCH 1/2] acct-user.eclass: Support ACCT_USER_ID override

2021-01-06 Thread Ulrich Mueller
> On Wed, 06 Jan 2021, Michał Górny wrote: > On Wed, 2021-01-06 at 14:25 +0100, Ulrich Mueller wrote: >> I wonder about this line. Both hyphen and underscore are valid >> characters in user names. >> >> So, ACCT_USER_FOO_BAR_ID would override the id for both foo_bar and >> foo-bar users. > I

Re: [gentoo-dev] [PATCH 1/2] acct-user.eclass: Support ACCT_USER_ID override

2021-01-06 Thread Thomas Deutschmann
Hi, On 2021-01-06 20:05, Patrick McLean wrote: This is so ACCT_USER_$foo can be set in make.conf, and not have to be specified as an environment variable whenever portage is run. This helps when automated systems are building Gentoo images or systems. Please see my reply to Alec for more deta

Re: [gentoo-dev] [PATCH 1/2] acct-user.eclass: Support ACCT_USER_ID override

2021-01-06 Thread Thomas Deutschmann
On 2021-01-06 20:12, Alec Warner wrote: Not sure I follow. Whether your automation sets a variable in /etc/portage/make.conf or /etc/portage/package.env; it's basically the same problem space; no? No. Assuming we will always stick to same variables, ACCT_USER_ID ACCT_USER_GROUPS ACCT_USER_SHE

Re: [gentoo-dev] [PATCH 1/2] acct-user.eclass: Support ACCT_USER_ID override

2021-01-06 Thread Alec Warner
On Wed, Jan 6, 2021 at 11:05 AM Patrick McLean wrote: > > On Wed, 6 Jan 2021 15:02:12 +0100 > Thomas Deutschmann wrote: > > > Hi, > > > > is there a specific reason why we want to support dynamic variables > > (ACCT_USER_$foo) at all? > > > > Isn't package.env support enough, i.e. use ACCT_USER_I

Re: [gentoo-dev] [PATCH 1/2] acct-user.eclass: Support ACCT_USER_ID override

2021-01-06 Thread Michał Górny
On Wed, 2021-01-06 at 14:25 +0100, Ulrich Mueller wrote: > > > > > > On Tue, 05 Jan 2021, Michał Górny wrote: > > > + # check for the override > > + local override_name=${ACCT_USER_NAME^^} > > + local override_var=ACCT_USER_${override_name//-/_}_ID > > I wonder about this line. Both hyphen

Re: [gentoo-dev] [PATCH 1/2] acct-user.eclass: Support ACCT_USER_ID override

2021-01-06 Thread Patrick McLean
On Wed, 6 Jan 2021 15:02:12 +0100 Thomas Deutschmann wrote: > Hi, > > is there a specific reason why we want to support dynamic variables > (ACCT_USER_$foo) at all? > > Isn't package.env support enough, i.e. use ACCT_USER_ID from environment > if set (which we should detect and log, maybe thi

Re: [gentoo-dev] [PATCH 1/2] acct-user.eclass: Support ACCT_USER_ID override

2021-01-06 Thread Thomas Deutschmann
Hi, is there a specific reason why we want to support dynamic variables (ACCT_USER_$foo) at all? Isn't package.env support enough, i.e. use ACCT_USER_ID from environment if set (which we should detect and log, maybe this will require a different namespace for the variables at all to be able

Re: [gentoo-dev] [PATCH 1/2] acct-user.eclass: Support ACCT_USER_ID override

2021-01-06 Thread Ulrich Mueller
> On Tue, 05 Jan 2021, Michał Górny wrote: > + # check for the override > + local override_name=${ACCT_USER_NAME^^} > + local override_var=ACCT_USER_${override_name//-/_}_ID I wonder about this line. Both hyphen and underscore are valid characters in user names. So, ACCT_USER_FOO

[gentoo-dev] [PATCH 1/2] acct-user.eclass: Support ACCT_USER_ID override

2021-01-05 Thread Michał Górny
Signed-off-by: Michał Górny --- eclass/acct-user.eclass | 31 --- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/eclass/acct-user.eclass b/eclass/acct-user.eclass index 5c55b8092c69..ca5a0b2e6b23 100644 --- a/eclass/acct-user.eclass +++ b/eclass/acct-u