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 0/8] Split off remaining functions from eutils.eclass
Date: Thu, 10 Sep 2020 19:09:06
Message-Id: 20200910190834.17560-1-ulm@gentoo.org
1 In the old times, eutils.eclass used to be inherited by almost all
2 ebuilds, mainly for the epatch function. Today, this is often no
3 longer needed since the package manager provides eapply() in EAPI 6
4 and later.
5
6 So, with introduction of EAPI 7, we had already moved most of the
7 functions in eutils.eclass to more specific eclasses. The hope back
8 then was that usage of eutils would further dwindle, and that the
9 eclass might be kept as a collection of small tools that don't fit
10 anywhere else.
11
12 Looking at the numbers today, I find these numbers of ebuilds
13 inheriting eutils.eclass:
14
15 37.6 % (3765 of 10013) in EAPI 6
16 38.3 % (6334 of 16546) in EAPI 7
17
18 Which means that there is no visible reduction. Even worse, of the
19 6334 ebuilds inheriting eutils in EAPI 7, only 140 actually call any
20 of its remaining functions.
21
22 Presumably many of the above inherits are caused by eutils being
23 indirectly inherited from other eclasses. Which means that ebuild
24 maintainers don't have any incentive to act (after all, their ebuilds
25 _don't_ inherit eutils). OTOH, eclass maintainers don't dare to remove
26 the eutils inherit, because it could potentially break ebuilds that
27 rely on indirect inheritance.
28
29 I think the only way to get out of this is to phase out eutils.eclass
30 entirely, by moving its remaining functions to other eclasses, or
31 deprecate them, as follows:
32
33 edos2unix: split out to new edos2unix.eclass
34 make_wrapper: split out to new wrapper.eclass
35 strip-linguas: move to l10n.eclass
36 emktemp: deprecate (create file in ${T} instead)
37 use_in_iuse: deprecate (only used in eclasses, where it can be inlined)
38
39 Please review the following series of patches.
40
41 (Note that this is to be applied on top of soap's optfeature patch:
42 https://github.com/gentoo/gentoo/pull/17452)
43
44 Ulrich Müller (8):
45 eutils.eclass: Specify supported EAPIs.
46 edos2unix.eclass: New eclass, split off from eutils.
47 wrapper.eclass: New eclass, split off from eutils.
48 wrapper.eclass: Do not use emktemp.
49 l10n.eclass: Add conditional to prevent multiple inclusion.
50 l10n.eclass: strip-linguas() moved from eutils to here.
51 eutils.eclass: Deprecate emktemp().
52 eutils.eclass: Deprecate use_if_iuse().
53
54 eclass/chromium-2.eclass | 4 +-
55 eclass/edos2unix.eclass | 21 +++++++
56 eclass/eutils.eclass | 128 +++++----------------------------------
57 eclass/gnome2.eclass | 2 +-
58 eclass/l10n.eclass | 54 ++++++++++++++++-
59 eclass/mate.eclass | 4 +-
60 eclass/toolchain.eclass | 77 ++++++++++++-----------
61 eclass/wrapper.eclass | 59 ++++++++++++++++++
62 8 files changed, 195 insertions(+), 154 deletions(-)
63 create mode 100644 eclass/edos2unix.eclass
64 create mode 100644 eclass/wrapper.eclass
65
66 --
67 2.28.0

Replies