Another simple issue, the dump_trace() function lacks quoting around the ${BASH_SOURCE} passed to basename. Due to that, whenever the ebuild/script path contains special characters, portage reports null source path and a basename call syntax error.
Created attachment 228983 [details, diff] Patch adding missing quoting
*** This bug has been marked as a duplicate of bug 315727 ***