Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 57900 | Differences between
and this patch

Collapse All | Expand All

(-)file_not_specified_in_diff (-27 / +85 lines)
Line 496 Link Here
496
egetent() {
497
	if [ "${ARCH}" == "macos" ] ; then	
498
		case "$2" in
499
		  *[!0-9]*) # Non numeric
500
			nidump $1 . | awk -F":" "{ if (\$1 ~ /^$2$/) {print \$0;exit;} }"
501
			;;
502
		  *)	# Numeric
503
			nidump $1 . | awk -F":" "{ if (\$3 == $2) {print \$0;exit;} }"
504
			;;
505
		esac
506
	else
507
		getent $1 $2
508
	fi
509
}
510
Line 506 Link Here
506
	if [ "${euser}" == "`getent passwd \"${euser}\" | cut -d: -f1`" ]
521
	if [ "${euser}" == "`egetent passwd \"${euser}\" | cut -d: -f1`" ]
507
--
Line 521 Link Here
521
			if [ ! -z "`getent passwd ${euid}`" ]
536
			if [ ! -z "`egetent passwd ${euid}`" ]
522
--
Lines 534-535 Link Here
534
		for euid in `seq 101 999` ; do
549
		local pwrange
535
			[ -z "`getent passwd ${euid}`" ] && break
550
		if [ "${ARCH}" == "macos" ] ; then
536
--
551
			pwrange="`jot 898 101`"
552
		else
553
			pwrange="`seq 101 999`"
554
		fi
555
		for euid in ${pwrange} ; do
556
			[ -z "`egetent passwd ${euid}`" ] && break
Line 573 Link Here
573
			if [ -z "`getent group \"${g}\"`" ]
594
			if [ -z "`egetent group \"${g}\"`" ]
574
--
Line 590 Link Here
590
	if [ -z "${eextra}" ]
611
	if [ "${ARCH}" == "macos" ];	
591
--
Lines 592-598 Link Here
592
		useradd ${opts} ${euser} \
613
		### Make the user
593
			-c "added by portage for ${PN}" \
614
		if [ -z "${eextra}" ]
594
			|| die "enewuser failed"
615
		then
595
	else
616
			dscl . create /users/${euser} uid ${euid}
596
		einfo " - Extra: ${eextra}"
617
			dscl . create /users/${euser} shell ${eshell}
597
		useradd ${opts} ${euser} ${eextra} \
618
			dscl . create /users/${euser} home ${ehome}
598
			|| die "enewuser failed"
619
			dscl . create /users/${euser} realname "added by portage for ${PN}"
599
--
620
			### Add the user to the groups specified
621
			for g in ${egroups}
622
			do
623
				dscl . merge /groups/${g} users ${euser}
624
			done
625
		else
626
			einfo "Extra options are not supported on macos yet"
627
			einfo "Please report the ebuild along with the info below"
628
			einfo "eextra: ${eextra}"
629
			die "Required function missing"
630
		fi
631
	else
632
		if [ -z "${eextra}" ]
633
		then
634
			useradd ${opts} ${euser} \
635
				-c "added by portage for ${PN}" \
636
				|| die "enewuser failed"
637
		else
638
			einfo " - Extra: ${eextra}"
639
			useradd ${opts} ${euser} ${eextra} \
640
				|| die "enewuser failed"
641
		fi
Line 630 Link Here
630
	if [ "${egroup}" == "`getent group \"${egroup}\" | cut -d: -f1`" ]
673
	if [ "${egroup}" == "`egetent group \"${egroup}\" | cut -d: -f1`" ]
631
--
Line 645 Link Here
645
			if [ -z "`getent group ${egid}`" ]
688
			if [ -z "`egetent group ${egid}`" ]
646
--
Line 647 Link Here
647
				opts="${opts} -g ${egid}"
690
				if [ "${ARCH}" == "macos" ] ; then
648
--
691
					opts="${opts} ${egid}"
692
				else
693
					opts="${opts} -g ${egid}"
694
				fi
Line 667 Link Here
667
	groupadd ${opts} ${egroup} || die "enewgroup failed"
714
	if [ "${ARCH}" == "macos" ];	
668
--
715
	then
716
		if [ ! -z "${eextra}" ];
717
		then
718
			einfo "Extra options are not supported on macos yet"
719
			einfo "Please report the ebuild along with the info below"
720
			einfo "eextra: ${eextra}"
721
			die "Required function missing"
722
		fi
723
		
724
		# If we need the next available
725
		case ${egid} in
726
		  *[!0-9]*) # Non numeric
727
			for egid in `jot 898 101`; do
728
				[ -z "`egetent group ${egid}`" ] && break
729
			done
730
		esac
731
		dscl . create /groups/${egroup} gid ${egid}
732
		dscl . create /groups/${egroup} passwd '*'	
733
	else
734
		groupadd ${opts} ${egroup} || die "enewgroup failed"
735
	fi

Return to bug 57900