Gentoo Archives: gentoo-dev

From: Julian Ospald <hasufell@g.o>
To: gentoo-dev@l.g.o
Cc: base-system@g.o, Julian Ospald <hasufell@g.o>
Subject: [gentoo-dev] [PATCH] eutils.eclass: Allow to configure base patch location for epatch_user
Date: Sat, 05 Sep 2015 10:46:43
Message-Id: 1441449982-30627-1-git-send-email-hasufell@gentoo.org
1 This is particularly useful for people who run alternative
2 package managers and want to control their configuration.
3
4 Github-PR: https://github.com/gentoo/gentoo/pull/69
5 ---
6 eclass/eutils.eclass | 14 ++++++++++----
7 1 file changed, 10 insertions(+), 4 deletions(-)
8
9 diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass
10 index fecd375..be65960 100644
11 --- a/eclass/eutils.eclass
12 +++ b/eclass/eutils.eclass
13 @@ -350,6 +350,12 @@ EPATCH_FORCE="no"
14 # List of patches not to apply. Note this is only file names,
15 # and not the full path. Globs accepted.
16
17 +# @VARIABLE: EPATCH_USER_SOURCE
18 +# @DESCRIPTION:
19 +# Location for user patches, see the epatch_user function.
20 +# Should be set by the user. Don't set this in ebuilds.
21 +: ${EPATCH_USER_SOURCE:=${PORTAGE_CONFIGROOT%/}/etc/portage/patches}
22 +
23 # @FUNCTION: epatch
24 # @USAGE: [options] [patches] [dirs of patches]
25 # @DESCRIPTION:
26 @@ -697,11 +703,11 @@ epatch_user() {
27 [[ -e ${applied} ]] && return 2
28
29 # don't clobber any EPATCH vars that the parent might want
30 - local EPATCH_SOURCE check base=${PORTAGE_CONFIGROOT%/}/etc/portage/patches
31 + local EPATCH_SOURCE check
32 for check in ${CATEGORY}/{${P}-${PR},${P},${PN}}{,:${SLOT}}; do
33 - EPATCH_SOURCE=${base}/${CTARGET}/${check}
34 - [[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${base}/${CHOST}/${check}
35 - [[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${base}/${check}
36 + EPATCH_SOURCE=${EPATCH_USER_SOURCE}/${CTARGET}/${check}
37 + [[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${EPATCH_USER_SOURCE}/${CHOST}/${check}
38 + [[ -r ${EPATCH_SOURCE} ]] || EPATCH_SOURCE=${EPATCH_USER_SOURCE}/${check}
39 if [[ -d ${EPATCH_SOURCE} ]] ; then
40 EPATCH_SOURCE=${EPATCH_SOURCE} \
41 EPATCH_SUFFIX="patch" \
42 --
43 2.5.1

Replies