Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Sun, 20 Dec 2015 15:07:26
Message-Id: 1450624031.0f52ef26a6ce7f4bd9718f7e67340271d8777dcc.mgorny@gentoo
1 commit: 0f52ef26a6ce7f4bd9718f7e67340271d8777dcc
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Dec 6 18:24:02 2015 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sun Dec 20 15:07:11 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0f52ef26
7
8 kernel-2.eclass: set UNIPATCH_LIST_GENPATCHES in src_unpack()
9
10 Modify genpatches logic to delay setting UNIPATCH_LIST_GENPATCHES until
11 src_unpack(). The value of UNIPATCH_LIST_GENPATCHES depends on state of
12 'use experimental', therefore it can not be obtained in global scope.
13 Therefore, handle_genpatches() will only set the URI when called in
14 global scope, and it will set UNIPATCH_LIST_GENPATCHES on request which
15 is done during kernel-2_src_unpack().
16
17 Fixes: https://bugs.gentoo.org/show_bug.cgi?id=566520
18
19 eclass/kernel-2.eclass | 19 ++++++++++++++++---
20 1 file changed, 16 insertions(+), 3 deletions(-)
21
22 diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
23 index 1a508f1..02da62a 100644
24 --- a/eclass/kernel-2.eclass
25 +++ b/eclass/kernel-2.eclass
26 @@ -132,9 +132,20 @@ debug-print-kernel2-variables() {
27 #Eclass functions only from here onwards ...
28 #==============================================================
29 handle_genpatches() {
30 - local tarball
31 + local tarball want_unipatch_list
32 [[ -z ${K_WANT_GENPATCHES} || -z ${K_GENPATCHES_VER} ]] && return 1
33
34 + if [[ -n ${1} ]]; then
35 + # set UNIPATCH_LIST_GENPATCHES only on explicit request
36 + # since that requires 'use' call which can be used only in phase
37 + # functions, while the function is also called in global scope
38 + if [[ ${1} == --set-unipatch-list ]]; then
39 + want_unipatch_list=1
40 + else
41 + die "Usage: ${FUNCNAME} [--set-unipatch-list]"
42 + fi
43 + fi
44 +
45 debug-print "Inside handle_genpatches"
46 local OKV_ARRAY
47 IFS="." read -r -a OKV_ARRAY <<<"${OKV}"
48 @@ -161,11 +172,11 @@ handle_genpatches() {
49 use_cond_start="experimental? ( "
50 use_cond_end=" )"
51
52 - if use experimental ; then
53 + if [[ -n ${want_unipatch_list} ]] && use experimental ; then
54 UNIPATCH_LIST_GENPATCHES+=" ${DISTDIR}/${tarball}"
55 debug-print "genpatches tarball: $tarball"
56 fi
57 - else
58 + elif [[ -n ${want_unipatch_list} ]]; then
59 UNIPATCH_LIST_GENPATCHES+=" ${DISTDIR}/${tarball}"
60 debug-print "genpatches tarball: $tarball"
61 fi
62 @@ -1232,6 +1243,8 @@ kernel-2_src_unpack() {
63 universal_unpack
64 debug-print "Doing unipatch"
65
66 + # request UNIPATCH_LIST_GENPATCHES in phase since it calls 'use'
67 + handle_genpatches --set-unipatch-list
68 [[ -n ${UNIPATCH_LIST} || -n ${UNIPATCH_LIST_DEFAULT} || -n ${UNIPATCH_LIST_GENPATCHES} ]] && \
69 unipatch "${UNIPATCH_LIST_DEFAULT} ${UNIPATCH_LIST_GENPATCHES} ${UNIPATCH_LIST}"