diff options
author | Michael Orlitzky <mjo@gentoo.org> | 2024-05-09 16:17:12 -0400 |
---|---|---|
committer | Michael Orlitzky <mjo@gentoo.org> | 2024-05-13 09:13:27 -0400 |
commit | bd3da28e258a68566d1abe18aa6713594adcd0ff (patch) | |
tree | 917442a5a6b5ac0a66b0a1f357c2e3694b4689a4 /eclass/acct-group.eclass | |
parent | eclass/acct-user.eclass: use $PN to construct make.conf override vars (diff) | |
download | gentoo-bd3da28e258a68566d1abe18aa6713594adcd0ff.tar.gz gentoo-bd3da28e258a68566d1abe18aa6713594adcd0ff.tar.bz2 gentoo-bd3da28e258a68566d1abe18aa6713594adcd0ff.zip |
eclass/acct-group.eclass: use $PN to construct make.conf override vars
If (after upcasing and replacing hyphens by underscores) ACCT_GROUP_NAME
is set to something that isn't valid in a bash variable name, the eclass
will crash: it uses ACCT_GROUP_NAME to construct the make.conf override
variables in pkg_pretend() and src_install(). This commit constructs the
variable names using PN instead of ACCT_GROUP_NAME. In ::gentoo, the two
are equivalent, but in an overlay this allows weirder group names at the
expense of slightly mismatched variable names.
Signed-off-by: Michael Orlitzky <mjo@gentoo.org>
Diffstat (limited to 'eclass/acct-group.eclass')
-rw-r--r-- | eclass/acct-group.eclass | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/eclass/acct-group.eclass b/eclass/acct-group.eclass index 6dd6dc06a07e..2c2c88cfc7e1 100644 --- a/eclass/acct-group.eclass +++ b/eclass/acct-group.eclass @@ -96,8 +96,9 @@ acct-group_pkg_pretend() { [[ ${ACCT_GROUP_ID} -ge -1 ]] || die "Ebuild error: ACCT_GROUP_ID=${ACCT_GROUP_ID} invalid!" local group_id=${ACCT_GROUP_ID} - # check for the override - local override_name=${ACCT_GROUP_NAME^^} + # check for the override, use PN in case this is an overlay and + # ACCT_GROUP_NAME is not PN and not valid in a bash variable name + local override_name=${PN^^} local override_var=ACCT_GROUP_${override_name//-/_}_ID if [[ -n ${!override_var} ]]; then group_id=${!override_var} @@ -132,8 +133,9 @@ acct-group_pkg_pretend() { acct-group_src_install() { debug-print-function ${FUNCNAME} "${@}" - # check for the override - local override_name=${ACCT_GROUP_NAME^^} + # check for the override, use PN in case this is an overlay and + # ACCT_GROUP_NAME is not PN and not valid in a bash variable name + local override_name=${PN^^} local override_var=ACCT_GROUP_${override_name//-/_}_ID if [[ -n ${!override_var} ]]; then ewarn "${override_var}=${!override_var} override in effect, support will not be provided." |