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

Diff of /eclass/eutils.eclass

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

Revision 1.101 Revision 1.102
1# Copyright 1999-2004 Gentoo Foundation 1# Copyright 1999-2004 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/eutils.eclass,v 1.101 2004/09/12 17:42:33 lv Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.102 2004/09/16 14:05:07 usata Exp $
4# 4#
5# Author: Martin Schlemmer <azarah@gentoo.org> 5# Author: Martin Schlemmer <azarah@gentoo.org>
6# 6#
7# This eclass is for general purpose functions that most ebuilds 7# This eclass is for general purpose functions that most ebuilds
8# have to implement themselves. 8# have to implement themselves.
555# used in enewuser()/enewgroup() 555# used in enewuser()/enewgroup()
556# Joe Jezak <josejx@gmail.com> and usata@gentoo.org 556# Joe Jezak <josejx@gmail.com> and usata@gentoo.org
557# 557#
558# egetent(database, key) 558# egetent(database, key)
559egetent() { 559egetent() {
560 if [ "${ARCH}" == "macos" ] ; then 560 if use macos || use ppc-macos ; then
561 case "$2" in 561 case "$2" in
562 *[!0-9]*) # Non numeric 562 *[!0-9]*) # Non numeric
563 nidump $1 . | awk -F":" "{ if (\$1 ~ /^$2$/) {print \$0;exit;} }" 563 nidump $1 . | awk -F":" "{ if (\$1 ~ /^$2$/) {print \$0;exit;} }"
564 ;; 564 ;;
565 *) # Numeric 565 *) # Numeric
621 euid="next" 621 euid="next"
622 fi 622 fi
623 if [ "${euid}" == "next" ] 623 if [ "${euid}" == "next" ]
624 then 624 then
625 local pwrange 625 local pwrange
626 if [ "${ARCH}" == "macos" ] ; then 626 if use macos || use ppc-macos ; then
627 pwrange="`jot 898 101`" 627 pwrange="`jot 898 101`"
628 else 628 else
629 pwrange="`seq 101 999`" 629 pwrange="`seq 101 999`"
630 fi 630 fi
631 for euid in ${pwrange} ; do 631 for euid in ${pwrange} ; do
682 682
683 # handle extra and add the user 683 # handle extra and add the user
684 local eextra="$@" 684 local eextra="$@"
685 local oldsandbox="${SANDBOX_ON}" 685 local oldsandbox="${SANDBOX_ON}"
686 export SANDBOX_ON="0" 686 export SANDBOX_ON="0"
687 if [ "${ARCH}" == "macos" ]; 687 if use macos || use ppc-macos ;
688 then 688 then
689 ### Make the user 689 ### Make the user
690 if [ -z "${eextra}" ] 690 if [ -z "${eextra}" ]
691 then 691 then
692 dscl . create /users/${euser} uid ${euid} 692 dscl . create /users/${euser} uid ${euid}
761 then 761 then
762 if [ "${egid}" -gt 0 ] 762 if [ "${egid}" -gt 0 ]
763 then 763 then
764 if [ -z "`egetent group ${egid}`" ] 764 if [ -z "`egetent group ${egid}`" ]
765 then 765 then
766 if [ "${ARCH}" == "macos" ] ; then 766 if use macos || use ppc-macos ; then
767 opts="${opts} ${egid}" 767 opts="${opts} ${egid}"
768 else 768 else
769 opts="${opts} -g ${egid}" 769 opts="${opts} -g ${egid}"
770 fi 770 fi
771 else 771 else
785 opts="${opts} ${eextra}" 785 opts="${opts} ${eextra}"
786 786
787 # add the group 787 # add the group
788 local oldsandbox="${SANDBOX_ON}" 788 local oldsandbox="${SANDBOX_ON}"
789 export SANDBOX_ON="0" 789 export SANDBOX_ON="0"
790 if [ "${ARCH}" == "macos" ]; 790 if use macos || use ppc-macos ;
791 then 791 then
792 if [ ! -z "${eextra}" ]; 792 if [ ! -z "${eextra}" ];
793 then 793 then
794 einfo "Extra options are not supported on macos yet" 794 einfo "Extra options are not supported on macos yet"
795 einfo "Please report the ebuild along with the info below" 795 einfo "Please report the ebuild along with the info below"

Legend:
Removed from v.1.101  
changed lines
  Added in v.1.102

  ViewVC Help
Powered by ViewVC 1.1.20