In OSX, when emerging software that requires a user to be added, eutils.eclass tries to use the getent, useradd and groupadd commands which are not present. This causes the ebuild to fail. I've attached a fixed eutils.eclass. The only thing missing from this is the eextra option, otherwise it should function exactly the same as on linux. To fix this shortcoming, we would need to finish mapping the options from useradd and groupadd to their OSX equivalents.
Created attachment 35921 [details, diff] Patch for eutils.eclass to fix adding users and groups on OSX
Added to CVS. Thanks for your contribution.
When the change was made from my original patch from [ "${ARCH}" == "macos" ] to use macos || use ppc-macos, code that depends upon the echo (egetent) broke. So we need to replace use with useq until portage stops having use echo. In addition, with ppc-macos set as my ACCEPT-KEYWORDS, I can't seem to get use ppc-macos to return true. Is this a known problem?
Replaced use with useq. Thanks for the bug report. ARCH had been changed to ppc from macos so this change was necessary but I hadn't tested the code with the change. Sorry for that. As for use ppc-macos, if you are using default-macos-10.x profile, use macos returns true and use ppc-macos false while with default-macos/ppc/10.x profile (stacked profile) use macos false and use ppc-macos true.
Ah okay, that explains it. There were a few other things that needed to be fixed as well, sorry about reopening the bug again, but even with the useq fixes it's not completely working. I've attached another diff of the current eutils.eclass (after the useq changes).
Created attachment 41201 [details, diff] Fix for adding users to groups
I see, useq fixes only part of the problem (it will fail if more than one groups are specified). I applied the patch you posted. Thanks. Feel free to reopen if there are any other problems ;)
comment #4: why do you use different ARCHes? 'macos' is not in arch.list and this results in QA notifications as in bug #66151. If necessary i'll open another bug.
We've been in transition from the macos keyword to the ppc-macos keyword as described in GLEP #22 (http://www.gentoo.org/proj/en/glep/glep-0022.html). We should be able to remove this from the eclass now as the transition is nearly complete. Besides eutils.eclass, the ruby eclass also should have macos removed. I'll do this tomorrow if noone has any objections.
Please make sure you update profiles to set USE="ppc-macos" at the same time. However, bug #67351 shows that USE="ppc-macos" is not but USE="macos" is set even though he uses stacked profile. I don't know why :( If you remove use macos from these eclasses he will have many problems. (but I'd rather say it "WORKSFORME")
Fixed in the latest installer and cascading profiles.
Closing out bugs that've been resolved for a while now...