Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: python@g.o, "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH] distutils-r1.eclass: Do not apply patches if DISTUTILS_OPTIONAL is used
Date: Sun, 15 May 2016 09:30:20
Message-Id: 1463304600-14662-1-git-send-email-mgorny@gentoo.org
1 Do not apply PATCHES and user patches (either via the EAPI 6 default or
2 pre-EAPI 5 code) when DISTUTILS_OPTIONAL is being used. In this case,
3 distutils functions are usually called conditionally, in a subdirectory,
4 while both PATCHES and user patches are usually intended to be applied
5 top-level.
6
7 There is no ebuild relying on distutils-r1_src_prepare applying patches
8 with DISTUTILS_OPTIONAL. In fact, there are ebuilds which work around
9 this behavior.
10 ---
11 eclass/distutils-r1.eclass | 12 +++++++-----
12 1 file changed, 7 insertions(+), 5 deletions(-)
13
14 diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
15 index e8de5ad..afd29ed 100644
16 --- a/eclass/distutils-r1.eclass
17 +++ b/eclass/distutils-r1.eclass
18 @@ -315,11 +315,13 @@ _distutils-r1_disable_ez_setup() {
19 distutils-r1_python_prepare_all() {
20 debug-print-function ${FUNCNAME} "${@}"
21
22 - if [[ ${EAPI} != [45] ]]; then
23 - default
24 - else
25 - [[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
26 - epatch_user
27 + if [[ ! ${DISTUTILS_OPTIONAL} ]]; then
28 + if [[ ${EAPI} != [45] ]]; then
29 + default
30 + else
31 + [[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
32 + epatch_user
33 + fi
34 fi
35
36 # by default, use in-source build if python_prepare() is used
37 --
38 2.8.2

Replies