Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 302572
Collapse All | Expand All

(-)eutils.eclass.old (-2 / +51 lines)
Lines 490-497 Link Here
490
		grep "$2:\*:" /etc/$1
489
		grep "$2:\*:" /etc/$1
491
		;;
490
		;;
492
	*)
491
	*)
493
		type -p nscd >& /dev/null && nscd -i "$1"
492
		# Only use grep if cross-helper is available. Otherwise it will
494
		getent "$1" "$2"
493
		# check entries in ${ROOT}/etc but files will be altered in /etc.
494
		if [[ ${CBUILD:-${CHOST}} != ${CHOST} ]] && [[ -n $(type -p cross-helper) ]] ; then
495
			[ ! -z "$(echo $2 | grep '^[0-9]*$')" ] &&
496
				# Numeric
497
				grep -m 1 "[^:]*:[^:]*:$2:" "${ROOT}"/etc/$1 ||
498
				# Non numeric
499
				grep -m 1 "^$2:" "${ROOT}"/etc/$1
500
		else
501
			type -p nscd >& /dev/null && nscd -i "$1"
502
			getent "$1" "$2"
503
		fi
495
		;;
504
		;;
496
	esac
505
	esac
497
}
506
}
Lines 680-692 Link Here
680
		;;
689
		;;
681
690
682
	*)
691
	*)
692
		# Use cross-helper while cross-compiling, if available.
693
		if [[ ${CBUILD:-${CHOST}} != ${CHOST} ]] ; then
694
			if [[ -z $(type -p cross-helper) ]] ; then
695
				ewarn "No cross-helper utility found while cross-compiling."
696
				ewarn "Install sys-apps/cross-helper to add users to the"
697
				ewarn "cross-compiled system."
698
				ewarn "This build will add the user ${euser} to your"
699
				ewarn "main system or hit CTRL+C to abort the emerge."
700
				ebeep 5
701
				
702
				USERADD_UTIL=
703
			else
704
				USERADD_UTIL="cross-helper"
705
			fi
706
		else
707
			USERADD_UTIL=
708
		fi
709
683
		if [[ -z $@ ]] ; then
710
		if [[ -z $@ ]] ; then
711
			${USERADD_UTIL} \
684
			useradd ${opts} \
712
			useradd ${opts} \
685
				-c "added by portage for ${PN}" \
713
				-c "added by portage for ${PN}" \
686
				${euser} \
714
				${euser} \
687
				|| die "enewuser failed"
715
				|| die "enewuser failed"
688
		else
716
		else
689
			einfo " - Extra: $@"
717
			einfo " - Extra: $@"
718
			${USERADD_UTIL} \
690
			useradd ${opts} "$@" \
719
			useradd ${opts} "$@" \
691
				${euser} \
720
				${euser} \
692
				|| die "enewuser failed"
721
				|| die "enewuser failed"
Lines 810-815 Link Here
810
		;;
839
		;;
811
840
812
	*)
841
	*)
842
		# Use cross-helper while cross-compiling, if available.
843
		if [[ ${CBUILD:-${CHOST}} != ${CHOST} ]] ; then
844
			if [[ -z $(type -p cross-helper) ]] ; then
845
				ewarn "No cross-helper utility found while cross-compiling."
846
				ewarn "Install sys-apps/cross-helper to add groups to the"
847
				ewarn "cross-compiled system."
848
				ewarn "This build will add the group ${egroup} to your"
849
				ewarn "main system or hit CTRL+C to abort the emerge."
850
				ebeep 5
851
				
852
				GROUPADD_UTIL=
853
			else
854
				GROUPADD_UTIL="cross-helper"
855
			fi
856
		else
857
			GROUPADD_UTIL=
858
		fi
859
860
		${GROUPADD_UTIL} \
813
		groupadd ${opts} ${egroup} || die "enewgroup failed"
861
		groupadd ${opts} ${egroup} || die "enewgroup failed"
814
		;;
862
		;;
815
	esac
863
	esac

Return to bug 302572