"emerge -v portage" fails to build with "exited unexpectedly" message when user or group contains spaces. Left with no clues from the logfiles, I went with my gut and opened Process Monitor to check process exit statuses and found several possible candidates. On inspecting the non-zero return code processes, I found that /opt/gentoo/bin/chown was returning an error status, so I wrapped it with a script (move chown to chown.orig and have the script call chown and return the proper status code while recording /proc/$$/cmdline and $? of chown) to see where it was failing, and what the status codes were. I believe I have part of the issue - chown appears to be called with the assumption that users and groups do not contain spaces. On the system that I am using, I am joined to a domain and my primary group is "Domain Users." This doesn't fix it completely, but it is part of the way there.
hey :) i know that there are some problems with this. until there is a propper fix, i can offer a workaround: search in /opt/gentoo/usr/lib/portage for your group name, and try replacing it with "None" or "Users" or whatever other group you're in ... that should work (it worked for me already sometimes...) let me know, whether this helped.
Thanks for the report. I'm closing this bug because a lot has changed since.