public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: "Michał Górny" <mgorny@gentoo.org>
Subject: [gentoo-dev] [PATCH v3 01/19] user.eclass: Remove dead/broken Darwin support
Date: Sun,  9 Jun 2019 13:27:56 +0200	[thread overview]
Message-ID: <20190609112814.15907-2-mgorny@gentoo.org> (raw)
In-Reply-To: <20190609112814.15907-1-mgorny@gentoo.org>

Closes: https://bugs.gentoo.org/687568
Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 eclass/user.eclass | 54 +++-------------------------------------------
 1 file changed, 3 insertions(+), 51 deletions(-)

diff --git a/eclass/user.eclass b/eclass/user.eclass
index f6a10a6bee28..ef5d3bc5e6e0 100644
--- a/eclass/user.eclass
+++ b/eclass/user.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: user.eclass
@@ -44,32 +44,6 @@ egetent() {
 	esac
 
 	case ${CHOST} in
-	*-darwin[678])
-		case ${key} in
-		*[!0-9]*) # Non numeric
-			nidump ${db} . | awk -F: "(\$1 ~ /^${key}\$/) {print;exit;}"
-			;;
-		*)	# Numeric
-			nidump ${db} . | awk -F: "(\$3 == ${key}) {print;exit;}"
-			;;
-		esac
-		;;
-	*-darwin*)
-		local mykey
-		case ${db} in
-		passwd) db="Users"  mykey="UniqueID" ;;
-		group)  db="Groups" mykey="PrimaryGroupID" ;;
-		esac
-
-		case ${key} in
-		*[!0-9]*) # Non numeric
-			dscl . -read /${db}/${key} 2>/dev/null |grep RecordName
-			;;
-		*)	# Numeric
-			dscl . -search /${db} ${mykey} ${key} 2>/dev/null
-			;;
-		esac
-		;;
 	*-freebsd*|*-dragonfly*)
 		case ${db} in
 		passwd) db="user" ;;
@@ -219,18 +193,6 @@ enewuser() {
 
 	# add the user
 	case ${CHOST} in
-	*-darwin*)
-		### Make the user
-		dscl . create "/users/${euser}" uid ${euid}
-		dscl . create "/users/${euser}" shell "${eshell}"
-		dscl . create "/users/${euser}" home "${ehome}"
-		dscl . create "/users/${euser}" realname "added by portage for ${PN}"
-		### Add the user to the groups specified
-		for g in "${egroups_arr[@]}" ; do
-			dscl . merge "/groups/${g}" users "${euser}"
-		done
-		;;
-
 	*-freebsd*|*-dragonfly*)
 		pw useradd "${euser}" "${opts[@]}" || die
 		;;
@@ -318,12 +280,6 @@ enewgroup() {
 
 	# add the group
 	case ${CHOST} in
-	*-darwin*)
-		_enewgroup_next_gid
-		dscl . create "/groups/${egroup}" gid ${egid}
-		dscl . create "/groups/${egroup}" passwd '*'
-		;;
-
 	*-freebsd*|*-dragonfly*)
 		_enewgroup_next_gid
 		pw groupadd "${egroup}" -g ${egid} || die
@@ -358,7 +314,7 @@ egethome() {
 	[[ $# -eq 1 ]] || die "usage: egethome <user>"
 
 	case ${CHOST} in
-	*-darwin*|*-freebsd*|*-dragonfly*)
+	*-freebsd*|*-dragonfly*)
 		pos=9
 		;;
 	*)	# Linux, NetBSD, OpenBSD, etc...
@@ -379,7 +335,7 @@ egetshell() {
 	[[ $# -eq 1 ]] || die "usage: egetshell <user>"
 
 	case ${CHOST} in
-	*-darwin*|*-freebsd*|*-dragonfly*)
+	*-freebsd*|*-dragonfly*)
 		pos=10
 		;;
 	*)	# Linux, NetBSD, OpenBSD, etc...
@@ -444,10 +400,6 @@ esethome() {
 
 	# update the home directory
 	case ${CHOST} in
-	*-darwin*)
-		dscl . change "/users/${euser}" home "${ehome}"
-		;;
-
 	*-freebsd*|*-dragonfly*)
 		pw usermod "${euser}" -d "${ehome}" && return 0
 		[[ $? == 8 ]] && eerror "${euser} is in use, cannot update home"
-- 
2.22.0.rc3



  reply	other threads:[~2019-06-09 11:29 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-09 11:27 [gentoo-dev] [PATCH v3 00/19] User/group packages Michał Górny
2019-06-09 11:27 ` Michał Górny [this message]
2019-06-09 11:27 ` [gentoo-dev] [PATCH v3 02/19] user.eclass: NetBSD has 'getent' Michał Górny
2019-06-09 11:27 ` [gentoo-dev] [PATCH v3 03/19] user.eclass: Do not create user-group automatically Michał Górny
2019-06-09 11:27 ` [gentoo-dev] [PATCH v3 04/19] user.eclass: Prevent automated home creation in useradd Michał Górny
2019-06-09 11:28 ` [gentoo-dev] [PATCH v3 05/19] user.eclass: Support disabling home directory creation Michał Górny
2019-06-09 11:28 ` [gentoo-dev] [PATCH v3 06/19] user.eclass: Support forcing specified UID/GID Michał Górny
2019-06-09 11:28 ` [gentoo-dev] [PATCH v3 07/19] user.eclass: Die if no free UID/GID is found Michał Górny
2019-06-09 11:28 ` [gentoo-dev] [PATCH v3 08/19] user.eclass: Factor out finding nologin into separate function Michał Górny
2019-06-09 11:28 ` [gentoo-dev] [PATCH v3 09/19] user.eclass: Introduce esetshell Michał Górny
2019-06-09 11:28 ` [gentoo-dev] [PATCH v3 10/19] user.eclass: Introduce eget{user,group}name Michał Górny
2019-06-09 16:18   ` Michael Orlitzky
2019-06-09 11:28 ` [gentoo-dev] [PATCH v3 11/19] user.eclass: Also permit using functions in pkg_*rm phases Michał Górny
2019-06-09 16:12   ` Michael Orlitzky
2019-06-09 11:28 ` [gentoo-dev] [PATCH v3 12/19] user.eclass: Support getting & setting comment field Michał Górny
2019-06-09 11:28 ` [gentoo-dev] [PATCH v3 13/19] user.eclass: Introduce e{get,set}groups Michał Górny
2019-06-09 11:28 ` [gentoo-dev] [PATCH v3 14/19] acct-group.eclass: A new eclass to maintain group accounts Michał Górny
2019-06-09 11:28 ` [gentoo-dev] [PATCH v3 15/19] acct-user.eclass: A new eclass to maintain user accounts Michał Górny
2019-06-09 11:35   ` Michał Górny
2019-06-09 11:28 ` [gentoo-dev] [PATCH v3 16/19] acct-user.eclass: Supporting locking & unlocking accounts Michał Górny
2019-06-09 11:28 ` [gentoo-dev] [PATCH v3 17/19] acct-group/ftp: Add 'ftp' group (GID 21) Michał Górny
2019-06-09 11:28 ` [gentoo-dev] [PATCH v3 18/19] acct-user/ftp: Add 'ftp' user (UID 21) Michał Górny
2019-06-09 11:28 ` [gentoo-dev] [PATCH v3 19/19] net-ftp/ftpbase: Utilize {group,user}/ftp Michał Górny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190609112814.15907-2-mgorny@gentoo.org \
    --to=mgorny@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox