diff options
Diffstat (limited to 'eclass/acct-user.eclass')
-rw-r--r-- | eclass/acct-user.eclass | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/eclass/acct-user.eclass b/eclass/acct-user.eclass index c87b27f3ccaa..f48e5a105a46 100644 --- a/eclass/acct-user.eclass +++ b/eclass/acct-user.eclass @@ -93,6 +93,13 @@ readonly ACCT_USER_NAME # to an already existing user. : ${ACCT_USER_NO_MODIFY:=} +# @ECLASS_VARIABLE: ACCT_USER_COMMENT +# @DEFAULT_UNSET +# @DESCRIPTION: +# The comment to use for the user. If not specified, the package +# DESCRIPTION will be used. This can be overridden in make.conf through +# ACCT_USER_<UPPERCASE_USERNAME>_COMMENT variable. + # @ECLASS_VARIABLE: ACCT_USER_SHELL # @DESCRIPTION: # The shell to use for the user. If not specified, a 'nologin' variant @@ -373,6 +380,10 @@ acct-user_pkg_pretend() { acct-user_src_install() { debug-print-function ${FUNCNAME} "${@}" + # Replace reserved characters in comment + : ${ACCT_USER_COMMENT:=${DESCRIPTION}} + ACCT_USER_COMMENT=${ACCT_USER_COMMENT//[:,=]/;} + # serialize for override support local ACCT_USER_GROUPS=${ACCT_USER_GROUPS[*]} @@ -380,7 +391,7 @@ acct-user_src_install() { local override_name=${ACCT_USER_NAME^^} override_name=${override_name//-/_} local var - for var in ACCT_USER_{ID,SHELL,HOME{,_OWNER,_PERMS},GROUPS}; do + for var in ACCT_USER_{ID,COMMENT,SHELL,HOME{,_OWNER,_PERMS},GROUPS}; do local var_name=ACCT_USER_${override_name}_${var#ACCT_USER_} if [[ -n ${!var_name} ]]; then ewarn "${var_name}=${!var_name} override in effect, support will not be provided." @@ -409,7 +420,7 @@ acct-user_src_install() { printf "u\t%q\t%q\t%q\t%q\t%q\n" \ "${ACCT_USER_NAME}" \ "${_ACCT_USER_ID/#-*/-}:${groups[0]}" \ - "${DESCRIPTION//[:,=]/;}" \ + "${_ACCT_USER_COMMENT}" \ "${_ACCT_USER_HOME}" \ "${_ACCT_USER_SHELL/#-*/-}" if [[ ${#groups[@]} -gt 1 ]]; then @@ -487,7 +498,7 @@ acct-user_pkg_postinst() { esetshell "${ACCT_USER_NAME}" "${_ACCT_USER_SHELL}" esetgroups "${ACCT_USER_NAME}" "${_ACCT_USER_GROUPS// /,}" # comment field can not contain colons - esetcomment "${ACCT_USER_NAME}" "${DESCRIPTION//[:,=]/;}" + esetcomment "${ACCT_USER_NAME}" "${_ACCT_USER_COMMENT}" eunlockuser "${ACCT_USER_NAME}" } |