From a32f54ee25dd7d5bc246155f7e708698b3827bd6 Mon Sep 17 00:00:00 2001 From: Tom Wijsman Date: Thu, 5 Sep 2013 17:04:26 +0000 Subject: Added support for experimental genpatches. --- eclass/ChangeLog | 5 ++++- eclass/kernel-2.eclass | 58 +++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 50 insertions(+), 13 deletions(-) diff --git a/eclass/ChangeLog b/eclass/ChangeLog index 43a92837dbd1..6a4912adf257 100644 --- a/eclass/ChangeLog +++ b/eclass/ChangeLog @@ -1,6 +1,9 @@ # ChangeLog for eclass directory # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.945 2013/09/05 09:59:52 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.946 2013/09/05 17:04:26 tomwij Exp $ + + 05 Sep 2013; Tom Wijsman kernel-2.eclass: + Added support for experimental genpatches. 05 Sep 2013; Michał Górny python-utils-r1.eclass: Disable Python 2.5, 3.1 and PyPy 1.9 in the eclass. diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass index 21032f8c85f8..ceac512f6c44 100644 --- a/eclass/kernel-2.eclass +++ b/eclass/kernel-2.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/kernel-2.eclass,v 1.287 2013/07/31 21:25:50 hasufell Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/kernel-2.eclass,v 1.288 2013/09/05 17:04:26 tomwij Exp $ # Description: kernel.eclass rewrite for a clean base regarding the 2.6 # series of kernel with back-compatibility for 2.4 @@ -40,7 +40,13 @@ # K_DEFCONFIG - Allow specifying a different defconfig target. # If length zero, defaults to "defconfig". # K_WANT_GENPATCHES - Apply genpatches to kernel source. Provide any -# combination of "base" and "extras" +# combination of "base", "extras" or "experimental". +# K_EXP_GENPATCHES_PULL - If set, we pull "experimental" regardless of the USE FLAG +# but expect the ebuild maintainer to use K_EXP_GENPATCHES_LIST. +# K_EXP_GENPATCHES_NOUSE - If set, no USE flag will be provided for "experimental"; +# as a result the user cannot choose to apply those patches. +# K_EXP_GENPATCHES_LIST - A list of patches to pick from "experimental" to apply when +# the USE flag is unset and K_EXP_GENPATCHES_PULL is set. # K_GENPATCHES_VER - The version of the genpatches tarball(s) to apply. # A value of "5" would apply genpatches-2.6.12-5 to # my-sources-2.6.12.ebuild @@ -130,18 +136,32 @@ handle_genpatches() { # respectively. Handle this. for i in ${K_WANT_GENPATCHES} ; do - if [[ ${KV_MAJOR} -ge 3 ]]; then - if [[ ${#OKV_ARRAY[@]} -ge 3 ]]; then - tarball="genpatches-${KV_MAJOR}.${KV_MINOR}-${K_GENPATCHES_VER}.${i}.tar.xz" + if [[ ${KV_MAJOR} -ge 3 ]]; then + if [[ ${#OKV_ARRAY[@]} -ge 3 ]]; then + tarball="genpatches-${KV_MAJOR}.${KV_MINOR}-${K_GENPATCHES_VER}.${i}.tar.xz" + else + tarball="genpatches-${KV_MAJOR}.${KV_PATCH}-${K_GENPATCHES_VER}.${i}.tar.xz" + fi else - tarball="genpatches-${KV_MAJOR}.${KV_PATCH}-${K_GENPATCHES_VER}.${i}.tar.xz" + tarball="genpatches-${OKV}-${K_GENPATCHES_VER}.${i}.tar.xz" fi - else - tarball="genpatches-${OKV}-${K_GENPATCHES_VER}.${i}.tar.xz" - fi - debug-print "genpatches tarball: $tarball" - GENPATCHES_URI="${GENPATCHES_URI} mirror://gentoo/${tarball}" - UNIPATCH_LIST_GENPATCHES="${UNIPATCH_LIST_GENPATCHES} ${DISTDIR}/${tarball}" + + local use_cond_start="" use_cond_end="" + + if [[ "${i}" == "experimental" && -z ${K_EXP_GENPATCHES_PULL} && -z ${K_EXP_GENPATCHES_NOUSE} ]] ; then + use_cond_start="experimental? ( " + use_cond_end=" )" + + if use experimental ; then + UNIPATCH_LIST_GENPATCHES+=" ${DISTDIR}/${tarball}" + debug-print "genpatches tarball: $tarball" + fi + else + UNIPATCH_LIST_GENPATCHES+=" ${DISTDIR}/${tarball}" + debug-print "genpatches tarball: $tarball" + fi + + GENPATCHES_URI+=" ${use_cond_start}mirror://gentoo/${tarball}${use_cond_end}" done } @@ -955,6 +975,20 @@ unipatch() { fi fi fi + + # If experimental was not chosen by the user, drop experimental patches not in K_EXP_GENPATCHES_LIST. + if [[ "${i}" == *"genpatches-"*".experimental."* && -n ${K_EXP_GENPATCHES_PULL} ]] ; then + if [[ -z ${K_EXP_GENPATCHES_NOUSE} ]] && use experimental; then + continue + fi + + local j + for j in ${KPATCH_DIR}/*/50*_*.patch*; do + if [[ ! "${K_EXP_GENPATCHES_LIST}" == *"$(basename ${j})"* ]] ; then + UNIPATCH_DROP+=" $(basename ${j})" + fi + done + fi done #populate KPATCH_DIRS so we know where to look to remove the excludes -- cgit v1.2.3-65-gdbad