As discussed in #gentoo-qa, the current implementation allows "clever" uses like PATCHES=( -p0 foo.patch bar.patch ). AFAICS this isn't used in the tree, but has been seen in at least one user-contributed ebuild. The proposal is to add -- as eapply's first parameter which would allow only file arguments in PATCHES. src_prepare() { if [[ $(declare -p PATCHES 2>/dev/null) == "declare -a"* ]]; then [[ -n ${PATCHES[@]} ]] && eapply -- "${PATCHES[@]}" else [[ -n ${PATCHES} ]] && eapply -- ${PATCHES} fi eapply_user }
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/portage.git/commit/?id=23727e2b902b2352aeed3ded659f19d5aa65898a commit 23727e2b902b2352aeed3ded659f19d5aa65898a Author: Michał Górny <mgorny@gentoo.org> AuthorDate: 2021-05-12 16:21:33 +0000 Commit: Zac Medico <zmedico@gentoo.org> CommitDate: 2021-05-24 04:47:49 +0000 Disallow options in PATCHES in EAPI 8 Bug: https://bugs.gentoo.org/752486 Signed-off-by: Michał Górny <mgorny@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org> bin/phase-functions.sh | 6 ++++++ bin/phase-helpers.sh | 11 +++++++++++ 2 files changed, 17 insertions(+)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/pms.git/commit/?id=a3693aec2011a666a437e3cea777012ac26fa1b2 commit a3693aec2011a666a437e3cea777012ac26fa1b2 Author: Ulrich Müller <ulm@gentoo.org> AuthorDate: 2021-05-16 19:06:02 +0000 Commit: Ulrich Müller <ulm@gentoo.org> CommitDate: 2021-06-05 08:55:37 +0000 EAPI 8: Default src_prepare doesn't accept options in PATCHES Also simplify array detection by using the @a operator in parameter expansion. This feature was introduced in bash-4.4. Bug: https://bugs.gentoo.org/752486 Signed-off-by: Ulrich Müller <ulm@gentoo.org> eapi-differences.tex | 3 ++- ebuild-functions.tex | 21 ++++++++++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-)