Gentoo Archives: gentoo-dev

From: "Marty E. Plummer" <hanetzer@×××××××××.com>
To: gentoo-dev@l.g.o
Cc: "Marty E. Plummer" <hanetzer@×××××××××.com>
Subject: [gentoo-dev] [PATCH] kernel-2.eclass: drop EAPI 0-1 support code
Date: Wed, 13 Jun 2018 07:24:18
Message-Id: 20180613072313.5264-1-hanetzer@startmail.com
1 Also went ahead and dropped versionator in favor of eapi7-ver for EAPI 0-6,
2 and eutils for epatch. multilib dropped as unneeded. All ebuilds using it
3 tested with ebuild clean install clean.
4
5 See also https://github.com/gentoo/gentoo/pull/8825
6
7 Bug: https://bugs.gentoo.org/657926
8 Package-Manager: Portage-2.3.40, Repoman-2.3.9
9 ---
10 eclass/kernel-2.eclass | 39 ++++++++++++++-------------------------
11 1 file changed, 14 insertions(+), 25 deletions(-)
12
13 diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
14 index 94937b6630b..ea99bdf39a1 100644
15 --- a/eclass/kernel-2.eclass
16 +++ b/eclass/kernel-2.eclass
17 @@ -192,11 +192,10 @@
18
19 PYTHON_COMPAT=( python{2_6,2_7} )
20
21 -inherit eutils toolchain-funcs versionator multilib python-any-r1
22 +inherit toolchain-funcs python-any-r1
23 +[[ ${EAPI:-0} == [012345] ]] && inherit epatch
24 +[[ ${EAPI:-0} == [0123456] ]] && inherit eapi7-ver
25 case ${EAPI:-0} in
26 - 0|1)
27 - EXPORT_FUNCTIONS src_{unpack,compile,install,test} \
28 - pkg_{setup,preinst,postinst,postrm} ;;
29 2|3|4|5|6)
30 EXPORT_FUNCTIONS src_{unpack,prepare,compile,install,test} \
31 pkg_{setup,preinst,postinst,postrm} ;;
32 @@ -216,8 +215,6 @@ fi
33 HOMEPAGE="https://www.kernel.org/ https://www.gentoo.org/ ${HOMEPAGE}"
34 : ${LICENSE:="GPL-2"}
35
36 -has "${EAPI:-0}" 0 1 2 && ED=${D} EPREFIX= EROOT=${ROOT}
37 -
38 # This is the latest KV_PATCH of the deblob tool available from the
39 # libre-sources upstream. If you bump this, you MUST regenerate the Manifests
40 # for ALL kernel-2 consumer packages where deblob is available.
41 @@ -326,7 +323,7 @@ detect_version() {
42 OKV=${OKV/-r*}
43 OKV=${OKV/_p*}
44
45 - KV_MAJOR=$(get_version_component_range 1 ${OKV})
46 + KV_MAJOR=$(ver_cut 1 ${OKV})
47 # handle if OKV is X.Y or X.Y.Z (e.g. 3.0 or 3.0.1)
48 local OKV_ARRAY
49 IFS="." read -r -a OKV_ARRAY <<<"${OKV}"
50 @@ -334,17 +331,17 @@ detect_version() {
51 # if KV_MAJOR >= 3, then we have no more KV_MINOR
52 #if [[ ${KV_MAJOR} -lt 3 ]]; then
53 if [[ ${#OKV_ARRAY[@]} -ge 3 ]]; then
54 - KV_MINOR=$(get_version_component_range 2 ${OKV})
55 - KV_PATCH=$(get_version_component_range 3 ${OKV})
56 + KV_MINOR=$(ver_cut 2 ${OKV})
57 + KV_PATCH=$(ver_cut 3 ${OKV})
58 if [[ ${KV_MAJOR}${KV_MINOR}${KV_PATCH} -ge 269 ]]; then
59 - KV_EXTRA=$(get_version_component_range 4- ${OKV})
60 + KV_EXTRA=$(ver_cut 4- ${OKV})
61 KV_EXTRA=${KV_EXTRA/[-_]*}
62 else
63 - KV_PATCH=$(get_version_component_range 3- ${OKV})
64 + KV_PATCH=$(ver_cut 3- ${OKV})
65 fi
66 else
67 - KV_PATCH=$(get_version_component_range 2 ${OKV})
68 - KV_EXTRA=$(get_version_component_range 3- ${OKV})
69 + KV_PATCH=$(ver_cut 2 ${OKV})
70 + KV_EXTRA=$(ver_cut 3- ${OKV})
71 KV_EXTRA=${KV_EXTRA/[-_]*}
72 fi
73
74 @@ -645,11 +642,7 @@ if [[ ${ETYPE} == sources ]]; then
75 DEBLOB_CHECK_A="deblob-check-${DEBLOB_PV}"
76 DEBLOB_HOMEPAGE="http://www.fsfla.org/svn/fsfla/software/linux-libre/releases/tags"
77 DEBLOB_URI_PATH="${DEBLOB_PV}${K_DEBLOB_TAG}"
78 - if ! has "${EAPI:-0}" 0 1 ; then
79 - DEBLOB_CHECK_URI="${DEBLOB_HOMEPAGE}/${DEBLOB_URI_PATH}/deblob-check -> ${DEBLOB_CHECK_A}"
80 - else
81 - DEBLOB_CHECK_URI="mirror://gentoo/${DEBLOB_CHECK_A}"
82 - fi
83 + DEBLOB_CHECK_URI="mirror://gentoo/${DEBLOB_CHECK_A}"
84
85 DEBLOB_URI="${DEBLOB_HOMEPAGE}/${DEBLOB_URI_PATH}/${DEBLOB_A}"
86 HOMEPAGE="${HOMEPAGE} ${DEBLOB_HOMEPAGE}"
87 @@ -1075,9 +1068,9 @@ postinst_sources() {
88 fi
89
90 # warn sparc users that they need to do cross-compiling with >= 2.6.25(bug #214765)
91 - KV_MAJOR=$(get_version_component_range 1 ${OKV})
92 - KV_MINOR=$(get_version_component_range 2 ${OKV})
93 - KV_PATCH=$(get_version_component_range 3 ${OKV})
94 + KV_MAJOR=$(ver_cut 1 ${OKV})
95 + KV_MINOR=$(ver_cut 2 ${OKV})
96 + KV_PATCH=$(ver_cut 3 ${OKV})
97 if [[ "$(tc-arch)" = "sparc" ]]; then
98 if [[ $(gcc-major-version) -lt 4 && $(gcc-minor-version) -lt 4 ]]; then
99 if [[ ${KV_MAJOR} -ge 3 || ${KV_MAJOR}.${KV_MINOR}.${KV_PATCH} > 2.6.24 ]] ; then
100 @@ -1476,10 +1469,6 @@ kernel-2_src_unpack() {
101 # we run misc `make` functions below
102 [[ $(type -t kernel-2_hook_premake) == "function" ]] && kernel-2_hook_premake
103
104 - case ${EAPI:-0} in
105 - 0|1) kernel-2_src_prepare ;;
106 - esac
107 -
108 debug-print "Doing unpack_set_extraversion"
109
110 [[ -z ${K_NOSETEXTRAVERSION} ]] && unpack_set_extraversion
111 --
112 2.17.1