Emerging dev-java/ant-core-1.8.0-r1 fails in install_qa_check_prefix() due to DOS line endings within the file src/script/runant.py, its shebang can not be prefixed.
Created attachment 222893 [details, diff] ant-core.patch Fixed by running edos2unix() on src/script/runant.py, this also makes the script directly executable again.
Please upgrade to portage 2.2.00.15801, it will properly deal with it. I leave it to the Java team to decide whether they want to fix the line endings of this file.
Probably only makes sense to fix it upstream, carrying around a patch for something that isn't actually broken isn't feasible. Thanks for the report and the fix in Portage.