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

Diff of /eclass/portability.eclass

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

Revision 1.7 Revision 1.8
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.7 2005/12/14 19:52:22 flameeyes Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/portability.eclass,v 1.8 2006/03/08 20:08:13 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#
68 ent=$(egetent passwd $1) 68 ent=$(egetent passwd $1)
69 69
70 case ${CHOST} in 70 case ${CHOST} in
71 *-darwin*|*-freebsd*|*-dragonfly*) 71 *-darwin*|*-freebsd*|*-dragonfly*)
72 # Darwin, OSX, FreeBSD and DragonFly use position 9 to store homedir 72 # Darwin, OSX, FreeBSD and DragonFly use position 9 to store homedir
73 cut -d: -f9 <<<${ent} 73 echo ${ent} | cut -d: -f9
74 ;; 74 ;;
75 *) 75 *)
76 # Linux, NetBSD and OpenBSD use position 6 instead 76 # Linux, NetBSD and OpenBSD use position 6 instead
77 cut -d: -f6 <<<${ent} 77 echo ${ent} | cut -d: -f6
78 ;; 78 ;;
79 esac 79 esac
80} 80}
81 81
82# Gets the shell for the specified user 82# Gets the shell for the specified user
88 ent=$(egetent passwd "$1") 88 ent=$(egetent passwd "$1")
89 89
90 case ${CHOST} in 90 case ${CHOST} in
91 *-darwin*|*-freebsd*|*-dragonfly*) 91 *-darwin*|*-freebsd*|*-dragonfly*)
92 # Darwin, OSX, FreeBSD and DragonFly use position 9 to store homedir 92 # Darwin, OSX, FreeBSD and DragonFly use position 9 to store homedir
93 cut -d: -f10 <<<${ent} 93 echo ${ent} | cut -d: -f10
94 ;; 94 ;;
95 *) 95 *)
96 # Linux, NetBSD and OpenBSD use position 6 instead 96 # Linux, NetBSD and OpenBSD use position 6 instead
97 cut -d: -f7 <<<${ent} 97 echo ${ent} cut -d: -f7
98 ;; 98 ;;
99 esac 99 esac
100} 100}
101 101
102# Returns true if specified user has a shell that precludes logins 102# Returns true if specified user has a shell that precludes logins

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.20