This update drops the function 'postgres_new_user', which was used to
create the 'postgres' user and group.

Additionally, this function accepted an argument to create a specified
user, which will be added to the 'postgres' group. This function is used
by exactly one package: dev-db/pgpool2.

With GLEP 81, such function is not needed anymore, as this can be easily
handled by the acct-* packages for dev-db/pgpool2.

Since many other packages depend on the 'postgres' and 'postgres-multi'
eclass, adding the core acct-*/postgres packages here to [R]DEPEND.

Before merging this eclass patch, acct-* packages will be added to
the tree. Afterwards, dev-db/pgpool2 will be migrated away from
'postgres_new_user'. After the eclass patch has been applied,
dev-db/postgres can be revbumped, so all users will get the acct-*
packages.

Signed-off-by: Conrad Kostecki <conik...@gentoo.org>
---
 eclass/postgres.eclass | 31 +++++--------------------------
 1 file changed, 5 insertions(+), 26 deletions(-)

diff --git a/eclass/postgres.eclass b/eclass/postgres.eclass
index 7652a862518..9b4097e0052 100644
--- a/eclass/postgres.eclass
+++ b/eclass/postgres.eclass
@@ -1,7 +1,6 @@
 # Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-inherit user
 EXPORT_FUNCTIONS pkg_setup
 
 # @ECLASS: postgres.eclass
@@ -119,31 +118,11 @@ postgres_check_slot() {
        fi
 }
 
-# @FUNCTION: postgres_new_user
-# @USAGE: [user [(uid|-1) [(shell|-1) [(homedir|-1) [groups]]]]]
-# @DESCRIPTION:
-# Creates the "postgres" system group and user -- which is separate from
-# the database user -- and, optionally, the developer defined user. There
-# are no required parameters.
-#
-# When given a user to create, it'll be created with the next available
-# uid, default shell set to /bin/false, default homedir is /dev/null,
-# and added to the "postgres" system group. You can use "-1" to skip any
-# parameter except user or groups.
-postgres_new_user() {
-       enewgroup postgres 70
-       enewuser postgres 70 /bin/bash /var/lib/postgresql postgres
-
-       if [[ $# -gt 0 ]] ; then
-               if [[ "$1" = "postgres" ]] ; then
-                       ewarn "Username 'postgres' implied, skipping"
-               else
-                       local groups=$5
-                       [[ -n "${groups}" ]] && groups+=",postgres" || 
groups="postgres"
-                       enewuser "$1" "${2:--1}" "${3:--1}" "${4:--1}" 
"${groups}"
-               fi
-       fi
-}
+RDEPEND="
+       acct-group/postgres
+       acct-user/postgres
+"
+DEPEND="${RDEPEND}"
 
 # @FUNCTION: postgres_pkg_setup
 # @DESCRIPTION:
-- 
2.32.0


Reply via email to