I noticed that a bunch of the do* scripts in /usr/lib/portage/bin/ call 'return' on failure (They were probably once shell functions?). This is erroneous and results in messages like this: /usr/lib/portage/bin/dosym: two arguments needed /usr/lib/portage/bin/dosym: return: can only `return' from a function or sourced script To reproduce, simply call /usr/lib/portage/bin/dosym /etc/passwd from a shell. This will give the above messages and call ln with a single argument, creating a link 'passwd' to /etc/passwd in the current directory. I've looked through all the do scripts and found the same bug in many. I replaced the return statements with 'exit 1'. I will attach a patch against my /usr/lib/portage/bin/ dir. I set up this Gentoo system just last week, so after checking with cvsweb, I think the files should all be the newest version.
Created attachment 1172 [details, diff] Patch to replace the return statement with 'exit 1'. Fixes the Bug. Use with -p0 from within the portage/bin dir.
Fixed on CVS; will be fixed in Portage 1.9.14. Thanks :)