summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2022-10-19 15:33:26 +0200
committerMichał Górny <mgorny@gentoo.org>2022-10-19 15:34:52 +0200
commit2e9ce053585446d6a63542c4657cd378c486c247 (patch)
tree5c4b6ead0a9d75df756dda53defa3526b92eeec5 /eclass
parentacct-user.eclass: Revert "support user override of comment" (diff)
downloadgentoo-2e9ce053585446d6a63542c4657cd378c486c247.tar.gz
gentoo-2e9ce053585446d6a63542c4657cd378c486c247.tar.bz2
gentoo-2e9ce053585446d6a63542c4657cd378c486c247.zip
acct-group.eclass: Revert "inline groupadd"
Reverts: acd0e195b2fba241d5eac52e34676a4a00493c2b Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/acct-group.eclass30
1 files changed, 3 insertions, 27 deletions
diff --git a/eclass/acct-group.eclass b/eclass/acct-group.eclass
index 3f38ac36ec4d..3d02e4f713b4 100644
--- a/eclass/acct-group.eclass
+++ b/eclass/acct-group.eclass
@@ -40,7 +40,7 @@ case ${EAPI:-0} in
*) die "EAPI=${EAPI:-0} not supported";;
esac
-inherit user-info
+inherit user
[[ ${CATEGORY} == acct-group ]] ||
die "Ebuild error: this eclass can be used only in acct-group category!"
@@ -156,32 +156,8 @@ acct-group_src_install() {
acct-group_pkg_preinst() {
debug-print-function ${FUNCNAME} "${@}"
- if [[ ${EUID} -ne 0 ]]; then
- einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
- return
- fi
-
- if egetent group "${ACCT_GROUP_NAME}" >/dev/null; then
- elog "Group ${ACCT_GROUP_NAME} already exists"
- return
- fi
-
- local opts=( --system )
-
- if [[ -z ${ACCT_GROUP_ENFORCE_ID} ]]; then
- opts+=( --force )
- fi
-
- if [[ ${_ACCT_GROUP_ID} -ne -1 ]]; then
- opts+=( --gid "${_ACCT_GROUP_ID}" )
- fi
-
- if [[ -n ${ROOT} ]]; then
- opts+=( --prefix "${ROOT}" )
- fi
-
- elog "Adding group ${ACCT_GROUP_NAME}"
- groupadd "${opts[@]}" "${ACCT_GROUP_NAME}" || die
+ enewgroup ${ACCT_GROUP_ENFORCE_ID:+-F} "${ACCT_GROUP_NAME}" \
+ "${_ACCT_GROUP_ID}"
}
fi