epatch_user() currently looks into CATEGORY/PF|P|PN subdirectories
of /etc/portage/patches. If the package has no revision, then PF and P
are identical, so there's no way to specify that a patch should only
apply to -r0.
The patch below changes ${PF} to ${P}-${PR}. Behaviour should be
identical for all non-zero revisions. For -r0 it will look in ${P}-r0
first, then in ${P} and ${PN}, as before.
--- eutils.eclass 3 Jan 2012 08:45:36 - 1.377
+++ eutils.eclass 29 Jan 2012 11:00:15 -
@@ -544,7 +544,7 @@
# don't clobber any EPATCH vars that the parent might want
local EPATCH_SOURCE check
base=${PORTAGE_CONFIGROOT%/}/etc/portage/patches
- for check in {${CATEGORY}/${PF},${CATEGORY}/${P},${CATEGORY}/${PN}}; do
+ for check in ${CATEGORY}/{${P}-${PR},${P},${PN}}; do
EPATCH_SOURCE=${base}/${CTARGET}/${check}
[[ -r ${EPATCH_SOURCE} ]] ||
EPATCH_SOURCE=${base}/${CHOST}/${check}
[[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${base}/${check}