diff options
author | Fabian Groffen <grobian@gentoo.org> | 2009-09-12 14:37:51 +0000 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2009-09-12 14:37:51 +0000 |
commit | 64d41207bc1051dfa74d567feb1ec28c8e471912 (patch) | |
tree | 0c4eb9852b57fdae112ad8f77d952e57af818ebe /eclass | |
parent | Bump, fixes #284677 (diff) | |
download | gentoo-2-64d41207bc1051dfa74d567feb1ec28c8e471912.tar.gz gentoo-2-64d41207bc1051dfa74d567feb1ec28c8e471912.tar.bz2 gentoo-2-64d41207bc1051dfa74d567feb1ec28c8e471912.zip |
properly detect OSX 10.6/Darwin 10, thanks Sören Kuklau in bug #284701
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/eutils.eclass | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass index 5b11d69c0b5a..655e05c8c253 100644 --- a/eclass/eutils.eclass +++ b/eclass/eutils.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.318 2009/08/26 21:47:56 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.319 2009/09/12 14:37:51 grobian Exp $ # @ECLASS: eutils.eclass # @MAINTAINER: @@ -417,28 +417,28 @@ emktemp() { # and pw (FreeBSD) used in enewuser()/enewgroup() egetent() { case ${CHOST} in - *-darwin9) - local mytype=$1 - [[ "passwd" == $mytype ]] && mytype="Users" - [[ "group" == $mytype ]] && mytype="Groups" + *-darwin[678]) case "$2" in *[!0-9]*) # Non numeric - dscl . -read /$mytype/$2 2>/dev/null |grep RecordName + nidump $1 . | awk -F":" "{ if (\$1 ~ /^$2$/) {print \$0;exit;} }" ;; *) # Numeric - local mykey="UniqueID" - [[ $mytype == "Groups" ]] && mykey="PrimaryGroupID" - dscl . -search /$mytype $mykey $2 2>/dev/null + nidump $1 . | awk -F":" "{ if (\$3 == $2) {print \$0;exit;} }" ;; esac ;; *-darwin*) + local mytype=$1 + [[ "passwd" == $mytype ]] && mytype="Users" + [[ "group" == $mytype ]] && mytype="Groups" case "$2" in *[!0-9]*) # Non numeric - nidump $1 . | awk -F":" "{ if (\$1 ~ /^$2$/) {print \$0;exit;} }" + dscl . -read /$mytype/$2 2>/dev/null |grep RecordName ;; *) # Numeric - nidump $1 . | awk -F":" "{ if (\$3 == $2) {print \$0;exit;} }" + local mykey="UniqueID" + [[ $mytype == "Groups" ]] && mykey="PrimaryGroupID" + dscl . -search /$mytype $mykey $2 2>/dev/null ;; esac ;; |