Re: [gentoo-dev] [RESEND PATCH 1/1] kernel-2.eclass: Fix eapply_user as per PMS spec and execute in, src_prepare. Support older EAPIs with epatch_user.

2016-12-01 Thread Mike Pagano
On 11/30/2016 07:32 PM, Mike Pagano wrote:
> Round 3. As per mgorny's additional advice, fix eapply_user as per PMS
> spec and execute in src_prepare. Support older EAPIs with epatch_user.
> export src_prepare only for supported EAPI versions.



mgorny, thanks for the feedback. Committed with peace and love. Peace.
And. Love.

-- 
Mike Pagano
Gentoo Developer - Kernel Project
Gentoo Sources - Lead
E-Mail : mpag...@gentoo.org
GnuPG FP   : 52CC A0B0 F631 0B17 0142 F83F 92A6 DBEC 81F2 B137
Public Key :
http://http://pgp.mit.edu/pks/lookup?search=0x92A6DBEC81F2B137=index




signature.asc
Description: OpenPGP digital signature


[gentoo-dev] [RESEND PATCH 1/1] kernel-2.eclass: Fix eapply_user as per PMS spec and execute in, src_prepare. Support older EAPIs with epatch_user.

2016-11-30 Thread Mike Pagano
Round 3. As per mgorny's additional advice, fix eapply_user as per PMS
spec and execute in src_prepare. Support older EAPIs with epatch_user.
export src_prepare only for supported EAPI versions.

---
 eclass/kernel-2.eclass | 35 ++-
 1 file changed, 26 insertions(+), 9 deletions(-)

diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
index 3f5fb3b..547153c 100644
--- a/eclass/kernel-2.eclass
+++ b/eclass/kernel-2.eclass
@@ -90,12 +90,18 @@
 # If you do change them, there is a chance that we will not fix
resulting bugs;
 # that of course does not mean we're not willing to help.

-has "${EAPI:-0}" 0 1 2 3 4 5 || die "kernel-2.eclass is unsupported for
EAPI ${EAPI}"
-
 PYTHON_COMPAT=( python{2_6,2_7} )

 inherit eutils toolchain-funcs versionator multilib python-any-r1
-EXPORT_FUNCTIONS pkg_setup src_unpack src_compile src_test src_install
pkg_preinst pkg_postinst pkg_postrm
+case ${EAPI:-0} in
+   0|1)
+   EXPORT_FUNCTIONS src_{unpack,compile,install,test} \
+   pkg_{setup,preinst,postinst,postrm} ;;
+   2|3|4|5)
+   EXPORT_FUNCTIONS src_{unpack,prepare,compile,install,test} \
+   pkg_{setup,preinst,postinst,postrm} ;;
+   *) die "${ECLASS}: EAPI ${EAPI} not supported" ;;
+esac

 # Added by Daniel Ostrow 
 # This is an ugly hack to get around an issue with a 32-bit userland on
ppc64.
@@ -1260,12 +1266,9 @@ kernel-2_src_unpack() {
# we run misc `make` functions below
[[ $(type -t kernel-2_hook_premake) == "function" ]] &&
kernel-2_hook_premake

-   debug-print "Applying any user patches"
-   # apply any user patches
-case ${EAPI:-0} in
-0|1|2|3|4|5) epatch_user ;;
-6) eapply_user ;;
-esac
+   case ${EAPI:-0} in
+   0|1) kernel-2_src_prepare ;;
+   esac

debug-print "Doing unpack_set_extraversion"

@@ -1305,6 +1308,20 @@ kernel-2_src_unpack() {
fi
 }

+# @FUNCTION: kernel-2_src_prepare
+# @DESCRIPTION:
+# Apply any user patches
+kernel-2_src_prepare() {
+
+   debug-print "Applying any user patches"
+
+   # apply any user patches
+   case ${EAPI:-0} in
+   0|1|2|3|4|5) epatch_user ;;
+   6) eapply_user ;;
+   esac
+}
+
 kernel-2_src_compile() {
cd "${S}"
[[ ${ETYPE} == headers ]] && compile_headers
-- 
2.7.3




signature.asc
Description: OpenPGP digital signature