diff options
author | Michał Górny <mgorny@gentoo.org> | 2015-12-06 19:24:02 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2015-12-20 16:07:11 +0100 |
commit | 0f52ef26a6ce7f4bd9718f7e67340271d8777dcc (patch) | |
tree | 360a08492113258888c1bab6cc8afa9f93fe7b88 | |
parent | dev-util/universalindentgui: use correct version of lrelease/update (diff) | |
download | gentoo-0f52ef26a6ce7f4bd9718f7e67340271d8777dcc.tar.gz gentoo-0f52ef26a6ce7f4bd9718f7e67340271d8777dcc.tar.bz2 gentoo-0f52ef26a6ce7f4bd9718f7e67340271d8777dcc.zip |
kernel-2.eclass: set UNIPATCH_LIST_GENPATCHES in src_unpack()
Modify genpatches logic to delay setting UNIPATCH_LIST_GENPATCHES until
src_unpack(). The value of UNIPATCH_LIST_GENPATCHES depends on state of
'use experimental', therefore it can not be obtained in global scope.
Therefore, handle_genpatches() will only set the URI when called in
global scope, and it will set UNIPATCH_LIST_GENPATCHES on request which
is done during kernel-2_src_unpack().
Fixes: https://bugs.gentoo.org/show_bug.cgi?id=566520
-rw-r--r-- | eclass/kernel-2.eclass | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass index 1a508f119aaf..02da62aa914c 100644 --- a/eclass/kernel-2.eclass +++ b/eclass/kernel-2.eclass @@ -132,9 +132,20 @@ debug-print-kernel2-variables() { #Eclass functions only from here onwards ... #============================================================== handle_genpatches() { - local tarball + local tarball want_unipatch_list [[ -z ${K_WANT_GENPATCHES} || -z ${K_GENPATCHES_VER} ]] && return 1 + if [[ -n ${1} ]]; then + # set UNIPATCH_LIST_GENPATCHES only on explicit request + # since that requires 'use' call which can be used only in phase + # functions, while the function is also called in global scope + if [[ ${1} == --set-unipatch-list ]]; then + want_unipatch_list=1 + else + die "Usage: ${FUNCNAME} [--set-unipatch-list]" + fi + fi + debug-print "Inside handle_genpatches" local OKV_ARRAY IFS="." read -r -a OKV_ARRAY <<<"${OKV}" @@ -161,11 +172,11 @@ handle_genpatches() { use_cond_start="experimental? ( " use_cond_end=" )" - if use experimental ; then + if [[ -n ${want_unipatch_list} ]] && use experimental ; then UNIPATCH_LIST_GENPATCHES+=" ${DISTDIR}/${tarball}" debug-print "genpatches tarball: $tarball" fi - else + elif [[ -n ${want_unipatch_list} ]]; then UNIPATCH_LIST_GENPATCHES+=" ${DISTDIR}/${tarball}" debug-print "genpatches tarball: $tarball" fi @@ -1232,6 +1243,8 @@ kernel-2_src_unpack() { universal_unpack debug-print "Doing unipatch" + # request UNIPATCH_LIST_GENPATCHES in phase since it calls 'use' + handle_genpatches --set-unipatch-list [[ -n ${UNIPATCH_LIST} || -n ${UNIPATCH_LIST_DEFAULT} || -n ${UNIPATCH_LIST_GENPATCHES} ]] && \ unipatch "${UNIPATCH_LIST_DEFAULT} ${UNIPATCH_LIST_GENPATCHES} ${UNIPATCH_LIST}" |