/[gentoo-x86]/eclass/portability.eclass
Gentoo

Diff of /eclass/portability.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.4 Revision 1.5
1# Copyright 1999-2005 Gentoo Foundation 1# Copyright 1999-2005 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/portability.eclass,v 1.4 2005/09/26 23:33:55 flameeyes Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/portability.eclass,v 1.5 2005/12/14 18:43:34 flameeyes Exp $
4# 4#
5# Author: Diego Pettenò <flameeyes@gentoo.org> 5# Author: Diego Pettenò <flameeyes@gentoo.org>
6# 6#
7# This eclass is created to avoid using non-portable GNUisms inside ebuilds 7# This eclass is created to avoid using non-portable GNUisms inside ebuilds
8# 8#
65# 65#
66# To use that, inherit eutils, not portability! 66# To use that, inherit eutils, not portability!
67egethome() { 67egethome() {
68 ent=$(egetent passwd $1) 68 ent=$(egetent passwd $1)
69 69
70 if [[ "${USERLAND}" == "Darwin" || "${ELIBC}" == "FreeBSD" ]]; then 70 case ${CHOST} in
71 *-darwin*|*-freebsd*|*-dragonfly*)
71 # Darwin/OSX and FreeBSD uses position 9 to store the home dir 72 # Darwin, OSX, FreeBSD and DragonFly use position 9 to store homedir
72 cut -d: -f9 <<<${ent} 73 cut -d: -f9 <<<${ent}
73 else 74 *)
74 # Linux and NetBSD uses position 6 instead 75 # Linux, NetBSD and OpenBSD use position 6 instead
75 cut -d: -f6 <<<${ent} 76 cut -d: -f6 <<<${ent}
76 fi 77 esac
77} 78}
78 79
79# Gets the name of the BSD-ish make command (pmake from NetBSD) 80# Gets the name of the BSD-ish make command (pmake from NetBSD)
80# 81#
81# This will return make (provided by system packages) for BSD userlands, 82# This will return make (provided by system packages) for BSD userlands,

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

  ViewVC Help
Powered by ViewVC 1.1.20