diff --git a/sdk_container/src/third_party/portage-stable/eclass/acct-group.eclass b/sdk_container/src/third_party/portage-stable/eclass/acct-group.eclass index a0ad860663..2c2c88cfc7 100644 --- a/sdk_container/src/third_party/portage-stable/eclass/acct-group.eclass +++ b/sdk_container/src/third_party/portage-stable/eclass/acct-group.eclass @@ -1,4 +1,4 @@ -# Copyright 2019-2023 Gentoo Authors +# Copyright 2019-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 # @ECLASS: acct-group.eclass @@ -50,12 +50,12 @@ inherit user-info # << Eclass variables >> # @ECLASS_VARIABLE: ACCT_GROUP_NAME -# @INTERNAL # @DESCRIPTION: # The name of the group. This is forced to ${PN} and the policy -# prohibits it from being changed. +# prohibits it from being changed. The variable is left writable for +# use in overlays; package naming restrictions would prohibit some +# otherwise-valid group names. ACCT_GROUP_NAME=${PN} -readonly ACCT_GROUP_NAME # @ECLASS_VARIABLE: ACCT_GROUP_ID # @REQUIRED @@ -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."