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

Diff of /eclass/eutils.eclass

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

Revision 1.196 Revision 1.197
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/eutils.eclass,v 1.196 2005/09/06 01:59:22 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/eutils.eclass,v 1.197 2005/09/18 17:33:44 flameeyes 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.
9# 9#
10# NB: If you add anything, please comment it! 10# NB: If you add anything, please comment it!
11 11
12inherit multilib 12inherit multilib portability
13 13
14DEPEND="!bootstrap? ( sys-devel/patch )" 14DEPEND="!bootstrap? ( sys-devel/patch )"
15# sys-apps/shadow is needed for useradd, etc, bug #94745. 15# sys-apps/shadow is needed for useradd, etc, bug #94745.
16 16
17DESCRIPTION="Based on the ${ECLASS} eclass" 17DESCRIPTION="Based on the ${ECLASS} eclass"
477 fi 477 fi
478 else 478 else
479 euid="next" 479 euid="next"
480 fi 480 fi
481 if [[ ${euid} == "next" ]] ; then 481 if [[ ${euid} == "next" ]] ; then
482 local pwrange 482 for euid in $(seq 101 999) ; do
483 if [[ ${USERLAND} == "BSD" ]] ; then
484 pwrange=$(jot 898 101)
485 else
486 pwrange=$(seq 101 999)
487 fi
488 for euid in ${pwrange} ; do
489 [[ -z $(egetent passwd ${euid}) ]] && break 483 [[ -z $(egetent passwd ${euid}) ]] && break
490 done 484 done
491 fi 485 fi
492 opts="${opts} -u ${euid}" 486 opts="${opts} -u ${euid}"
493 einfo " - Userid: ${euid}" 487 einfo " - Userid: ${euid}"
677 fi 671 fi
678 672
679 # If we need the next available 673 # If we need the next available
680 case ${egid} in 674 case ${egid} in
681 *[!0-9]*) # Non numeric 675 *[!0-9]*) # Non numeric
682 for egid in `jot 898 101`; do 676 for egid in $(seq 101 999); do
683 [ -z "`egetent group ${egid}`" ] && break 677 [ -z "`egetent group ${egid}`" ] && break
684 done 678 done
685 esac 679 esac
686 dscl . create /groups/${egroup} gid ${egid} 680 dscl . create /groups/${egroup} gid ${egid}
687 dscl . create /groups/${egroup} passwd '*' 681 dscl . create /groups/${egroup} passwd '*'
688 elif [[ "${USERLAND}" == "BSD" ]] ; then 682 elif [[ "${USERLAND}" == "BSD" ]] ; then
689 case ${egid} in 683 case ${egid} in
690 *[!0-9]*) # Non numeric 684 *[!0-9]*) # Non numeric
691 for egid in `jot 898 101`; do 685 for egid in $(seq 101 999); do
692 [ -z "`egetent group ${egid}`" ] && break 686 [ -z "`egetent group ${egid}`" ] && break
693 done 687 done
694 esac 688 esac
695 pw groupadd ${egroup} -g ${egid} || die "enewgroup failed" 689 pw groupadd ${egroup} -g ${egid} || die "enewgroup failed"
696 else 690 else

Legend:
Removed from v.1.196  
changed lines
  Added in v.1.197

  ViewVC Help
Powered by ViewVC 1.1.20