Not sure if this is limited to also using distutils-r1 or not but all you should have to do is have this in your ebuild to reproduce ' PATCHES=( )
The spec says the default src_prepare should look like this: src_prepare() { if declare -p PATCHES | grep -q "^declare -a "; then [[ -n ${PATCHES[@]} ]] && eapply "${PATCHES[@]}" else [[ -n ${PATCHES} ]] && eapply ${PATCHES} fi eapply_user } Here's what we currently have: __eapi6_src_prepare() { if [[ $(declare -p PATCHES 2>/dev/null) == "declare -a"* ]]; then eapply "${PATCHES[@]}" elif [[ -n ${PATCHES} ]]; then eapply ${PATCHES} fi eapply_user }
There's a patch in the following branch: https://github.com/zmedico/portage/tree/bug_579626 I've posted it for review here: https://archives.gentoo.org/gentoo-portage-dev/message/f2efa8da238b727c478fb06910bbd8fd
This is in the master branch: https://gitweb.gentoo.org/proj/portage.git/commit/?id=363355277eca757af4c435a0592c1feedc31a097
Fixed in portage-2.3.0.