Gentoo Archives: gentoo-dev

From: "Ulrich Müller" <ulm@g.o>
To: gentoo-dev@l.g.o
Cc: "Ulrich Müller" <ulm@g.o>
Subject: [gentoo-dev] [PATCH 1/7] eutils.eclass: Drop support for EAPI 5
Date: Tue, 28 Jun 2022 17:25:39
Message-Id: 20220628172502.30372-2-ulm@gentoo.org
In Reply to: [gentoo-dev] [PATCH 0/7] Drop support for EAPI 5 in eutils and its friends by "Ulrich Müller"
1 Signed-off-by: Ulrich Müller <ulm@g.o>
2 ---
3 eclass/eutils.eclass | 100 +++----------------------------------------
4 1 file changed, 5 insertions(+), 95 deletions(-)
5
6 diff --git a/eclass/eutils.eclass b/eclass/eutils.eclass
7 index 207d05e7f975..0b84e3c82c00 100644
8 --- a/eclass/eutils.eclass
9 +++ b/eclass/eutils.eclass
10 @@ -1,10 +1,10 @@
11 -# Copyright 1999-2021 Gentoo Authors
12 +# Copyright 1999-2022 Gentoo Authors
13 # Distributed under the terms of the GNU General Public License v2
14
15 # @ECLASS: eutils.eclass
16 # @MAINTAINER:
17 # base-system@g.o
18 -# @SUPPORTED_EAPIS: 5 6 7
19 +# @SUPPORTED_EAPIS: 6 7
20 # @BLURB: many extra (but common) functions that are used in ebuilds
21 # @DESCRIPTION:
22 # The eutils eclass contains a suite of functions that complement
23 @@ -24,10 +24,8 @@ _EUTILS_ECLASS=1
24
25 # implicitly inherited (now split) eclasses
26 case ${EAPI} in
27 - 5|6)
28 - inherit desktop edos2unix epatch estack ltprune multilib \
29 - preserve-libs strip-linguas toolchain-funcs vcs-clean wrapper
30 - ;;
31 + 6) inherit desktop edos2unix epatch estack ltprune multilib \
32 + preserve-libs strip-linguas toolchain-funcs vcs-clean wrapper ;;
33 7) inherit edos2unix strip-linguas wrapper ;;
34 *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
35 esac
36 @@ -90,105 +88,17 @@ use_if_iuse() {
37 use $1
38 }
39
40 -if [[ ${EAPI} == 5 ]] ; then
41 -
42 -# @FUNCTION: einstalldocs
43 -# @DESCRIPTION:
44 -# Install documentation using DOCS and HTML_DOCS, in EAPIs that do not
45 -# provide this function. When available (i.e., in EAPI 6 or later),
46 -# the package manager implementation should be used instead.
47 -#
48 -# If DOCS is declared and non-empty, all files listed in it are
49 -# installed. The files must exist, otherwise the function will fail.
50 -# In EAPI 4 and 5, DOCS may specify directories as well; in earlier
51 -# EAPIs using directories is unsupported.
52 -#
53 -# If DOCS is not declared, the files matching patterns given
54 -# in the default EAPI implementation of src_install will be installed.
55 -# If this is undesired, DOCS can be set to empty value to prevent any
56 -# documentation from being installed.
57 -#
58 -# If HTML_DOCS is declared and non-empty, all files and/or directories
59 -# listed in it are installed as HTML docs (using dohtml).
60 -#
61 -# Both DOCS and HTML_DOCS can either be an array or a whitespace-
62 -# separated list. Whenever directories are allowed, '<directory>/.' may
63 -# be specified in order to install all files within the directory
64 -# without creating a sub-directory in docdir.
65 -#
66 -# Passing additional options to dodoc and dohtml is not supported.
67 -# If you needed such a thing, you need to call those helpers explicitly.
68 -einstalldocs() {
69 - debug-print-function ${FUNCNAME} "${@}"
70 -
71 - local dodoc_opts=-r
72 -
73 - if ! declare -p DOCS &>/dev/null ; then
74 - local d
75 - for d in README* ChangeLog AUTHORS NEWS TODO CHANGES \
76 - THANKS BUGS FAQ CREDITS CHANGELOG ; do
77 - if [[ -s ${d} ]] ; then
78 - dodoc "${d}" || die
79 - fi
80 - done
81 - elif [[ $(declare -p DOCS) == "declare -a"* ]] ; then
82 - if [[ ${DOCS[@]} ]] ; then
83 - dodoc ${dodoc_opts} "${DOCS[@]}" || die
84 - fi
85 - else
86 - if [[ ${DOCS} ]] ; then
87 - dodoc ${dodoc_opts} ${DOCS} || die
88 - fi
89 - fi
90 -
91 - if [[ $(declare -p HTML_DOCS 2>/dev/null) == "declare -a"* ]] ; then
92 - if [[ ${HTML_DOCS[@]} ]] ; then
93 - dohtml -r "${HTML_DOCS[@]}" || die
94 - fi
95 - else
96 - if [[ ${HTML_DOCS} ]] ; then
97 - dohtml -r ${HTML_DOCS} || die
98 - fi
99 - fi
100 -
101 - return 0
102 -}
103 -
104 -# @FUNCTION: in_iuse
105 -# @USAGE: <flag>
106 -# @DESCRIPTION:
107 -# Determines whether the given flag is in IUSE. Strips IUSE default
108 -# prefixes as necessary. In EAPIs where it is available (i.e., EAPI 6
109 -# or later), the package manager implementation should be used instead.
110 -#
111 -# Note that this function must not be used in the global scope.
112 -in_iuse() {
113 - debug-print-function ${FUNCNAME} "${@}"
114 - [[ ${#} -eq 1 ]] || die "Invalid args to ${FUNCNAME}()"
115 -
116 - local flag=${1}
117 - local liuse=( ${IUSE} )
118 -
119 - has "${flag}" "${liuse[@]#[+-]}"
120 -}
121 -
122 -fi # EAPI 5
123 -
124 -if [[ ${EAPI} == [56] ]] ; then
125 -
126 # @FUNCTION: eqawarn
127 # @USAGE: [message]
128 # @DESCRIPTION:
129 # Proxy to ewarn for package managers that don't provide eqawarn and use the PM
130 # implementation if available. Reuses PORTAGE_ELOG_CLASSES as set by the dev
131 # profile.
132 -if ! declare -F eqawarn >/dev/null ; then
133 +if [[ ${EAPI} == 6 ]] && ! declare -F eqawarn >/dev/null ; then
134 eqawarn() {
135 has qa ${PORTAGE_ELOG_CLASSES} && ewarn "$@"
136 :
137 }
138 fi
139
140 -fi # EAPI [56]
141 -
142 fi
143 --
144 2.35.1