mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-14 00:16:59 +02:00
eclass/acct-group: Sync with Gentoo
It's from Gentoo commit bd3da28e258a68566d1abe18aa6713594adcd0ff.
This commit is contained in:
parent
9947b686f3
commit
45b136c461
@ -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."
|
||||
|
Loading…
Reference in New Issue
Block a user