The problem is stated at http://bugs.gentoo.org/show_bug.cgi?id=10872 I am posting here because of comment #6 to bug 10872.
It's been a while. Maybe I didn't state properly, but sometimes $S contains spaces and ebuild.sh produces errors in such situations. Putting quotes around ${S} fixes those errors.
Created attachment 12839 [details, diff] ebuild.sh.patch changes /usr/bin/ebuild.sh so that ${S} -> "${S}"
According to the changelog, portage had the problem fixed on the 29th of May this year (but the update was not unmasked until today) I guess. Could someone close the bug please?
There are more related 'space' issues. General policy is to not have them, but more support is slowly creeping in.
I noticed some extra quoting got added to portage 2.0.48-r5, but you missed the export line in insinto() (quotes added by me): export INSDESTTREE="$1" This is needed for the current 1.1rc openoffice ebuild (there's a space in the /usr/share/applink/OpenOffice.org\ 1.1 directory name).