eclass/acct-user: Sync with Gentoo

It's from Gentoo commit c8af7eb1285a2683460618b71e2e9a14ca6badcd.
This commit is contained in:
Flatcar Buildbot 2024-10-21 07:06:03 +00:00
parent a2b904afdc
commit 1c7aee24b7

View File

@ -155,7 +155,7 @@ S=${WORKDIR}
# Generate appropriate RDEPEND from ACCT_USER_GROUPS. This must be # Generate appropriate RDEPEND from ACCT_USER_GROUPS. This must be
# called if ACCT_USER_GROUPS are set. # called if ACCT_USER_GROUPS are set.
acct-user_add_deps() { acct-user_add_deps() {
debug-print-function ${FUNCNAME} "${@}" debug-print-function ${FUNCNAME} "$@"
# ACCT_USER_GROUPS sanity check # ACCT_USER_GROUPS sanity check
if [[ $(declare -p ACCT_USER_GROUPS) != "declare -a"* ]]; then if [[ $(declare -p ACCT_USER_GROUPS) != "declare -a"* ]]; then
@ -218,7 +218,7 @@ eislocked() {
# Performs sanity checks for correct eclass usage, and early-checks # Performs sanity checks for correct eclass usage, and early-checks
# whether requested UID can be enforced. # whether requested UID can be enforced.
acct-user_pkg_pretend() { acct-user_pkg_pretend() {
debug-print-function ${FUNCNAME} "${@}" debug-print-function ${FUNCNAME} "$@"
# verify that acct-user_add_deps() has been called # verify that acct-user_add_deps() has been called
# (it verifies ACCT_USER_GROUPS itself) # (it verifies ACCT_USER_GROUPS itself)
@ -267,7 +267,7 @@ acct-user_pkg_pretend() {
# Installs a keep-file into the user's home directory to ensure it is # Installs a keep-file into the user's home directory to ensure it is
# owned by the package, and sysusers.d file. # owned by the package, and sysusers.d file.
acct-user_src_install() { acct-user_src_install() {
debug-print-function ${FUNCNAME} "${@}" debug-print-function ${FUNCNAME} "$@"
# Replace reserved characters in comment # Replace reserved characters in comment
: "${ACCT_USER_COMMENT:=${DESCRIPTION//[:,=]/;}}" : "${ACCT_USER_COMMENT:=${DESCRIPTION//[:,=]/;}}"
@ -328,7 +328,7 @@ acct-user_src_install() {
# Creates the user if it does not exist yet. Sets permissions # Creates the user if it does not exist yet. Sets permissions
# of the home directory in install image. # of the home directory in install image.
acct-user_pkg_preinst() { acct-user_pkg_preinst() {
debug-print-function ${FUNCNAME} "${@}" debug-print-function ${FUNCNAME} "$@"
unset _ACCT_USER_ADDED unset _ACCT_USER_ADDED
@ -397,7 +397,7 @@ acct-user_pkg_preinst() {
# Updates user properties if necessary. This needs to be done after # Updates user properties if necessary. This needs to be done after
# new home directory is installed. # new home directory is installed.
acct-user_pkg_postinst() { acct-user_pkg_postinst() {
debug-print-function ${FUNCNAME} "${@}" debug-print-function ${FUNCNAME} "$@"
if [[ -n ${_ACCT_USER_ADDED} ]]; then if [[ -n ${_ACCT_USER_ADDED} ]]; then
# We just added the user; no need to update it # We just added the user; no need to update it
@ -481,7 +481,7 @@ acct-user_pkg_postinst() {
# @DESCRIPTION: # @DESCRIPTION:
# Ensures that the user account is locked out when it is removed. # Ensures that the user account is locked out when it is removed.
acct-user_pkg_prerm() { acct-user_pkg_prerm() {
debug-print-function ${FUNCNAME} "${@}" debug-print-function ${FUNCNAME} "$@"
if [[ -n ${REPLACED_BY_VERSION} ]]; then if [[ -n ${REPLACED_BY_VERSION} ]]; then
return return