Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Fri, 02 Jul 2021 15:35:41
Message-Id: 1625239947.5c91b95ebd648e882ea42640c46d63db98f635fa.floppym@gentoo
1 commit: 5c91b95ebd648e882ea42640c46d63db98f635fa
2 Author: David Michael <fedora.dm0 <AT> gmail <DOT> com>
3 AuthorDate: Thu Jun 24 20:04:58 2021 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Fri Jul 2 15:32:27 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5c91b95e
7
8 systemd.eclass: EAPI 8 support
9
10 This also drops EAPIs < 5 to match toolchain-funcs.eclass. (Its
11 support for EAPI 0 is an implementation detail so crossdev can
12 source it, which is not relevant here.)
13
14 Signed-off-by: David Michael <fedora.dm0 <AT> gmail.com>
15 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
16
17 eclass/systemd.eclass | 44 +++++++++++++++++---------------------------
18 1 file changed, 17 insertions(+), 27 deletions(-)
19
20 diff --git a/eclass/systemd.eclass b/eclass/systemd.eclass
21 index 397a863cf25..27e4dcae1ff 100644
22 --- a/eclass/systemd.eclass
23 +++ b/eclass/systemd.eclass
24 @@ -4,7 +4,7 @@
25 # @ECLASS: systemd.eclass
26 # @MAINTAINER:
27 # systemd@g.o
28 -# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7
29 +# @SUPPORTED_EAPIS: 5 6 7 8
30 # @BLURB: helper functions to install systemd units
31 # @DESCRIPTION:
32 # This eclass provides a set of functions to install unit files for
33 @@ -24,14 +24,14 @@
34 # }
35 # @CODE
36
37 -inherit toolchain-funcs
38 -
39 -case ${EAPI:-0} in
40 - 0|1|2|3|4|5|6|7) ;;
41 - *) die "${ECLASS}.eclass API in EAPI ${EAPI} not yet established."
42 +case ${EAPI} in
43 + 5|6|7|8) ;;
44 + *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
45 esac
46
47 -if [[ ${EAPI:-0} == [0123456] ]]; then
48 +inherit toolchain-funcs
49 +
50 +if [[ ${EAPI} == [56] ]]; then
51 DEPEND="virtual/pkgconfig"
52 else
53 BDEPEND="virtual/pkgconfig"
54 @@ -72,7 +72,6 @@ _systemd_get_systemunitdir() {
55 # ${D}). This function always succeeds, even if systemd is not
56 # installed.
57 systemd_get_systemunitdir() {
58 - has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
59 debug-print-function ${FUNCNAME} "${@}"
60
61 echo "${EPREFIX}$(_systemd_get_systemunitdir)"
62 @@ -82,7 +81,7 @@ systemd_get_systemunitdir() {
63 # @DESCRIPTION:
64 # Deprecated alias for systemd_get_systemunitdir.
65 systemd_get_unitdir() {
66 - [[ ${EAPI} == [012345] ]] || die "${FUNCNAME} is banned in EAPI 6, use systemd_get_systemunitdir instead"
67 + [[ ${EAPI} == 5 ]] || die "${FUNCNAME} is banned in EAPI 6, use systemd_get_systemunitdir instead"
68
69 systemd_get_systemunitdir
70 }
71 @@ -101,7 +100,6 @@ _systemd_get_userunitdir() {
72 # ${D}). This function always succeeds, even if systemd is not
73 # installed.
74 systemd_get_userunitdir() {
75 - has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
76 debug-print-function ${FUNCNAME} "${@}"
77
78 echo "${EPREFIX}$(_systemd_get_userunitdir)"
79 @@ -121,7 +119,6 @@ _systemd_get_utildir() {
80 # ${D}). This function always succeeds, even if systemd is not
81 # installed.
82 systemd_get_utildir() {
83 - has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
84 debug-print-function ${FUNCNAME} "${@}"
85
86 echo "${EPREFIX}$(_systemd_get_utildir)"
87 @@ -138,10 +135,8 @@ _systemd_get_systemgeneratordir() {
88 # @FUNCTION: systemd_get_systemgeneratordir
89 # @DESCRIPTION:
90 # Output the path for the systemd system generator directory (not including
91 -# ${D}). This function always succeeds, even if systemd is not
92 -# installed.
93 +# ${D}). This function always succeeds, even if systemd is not installed.
94 systemd_get_systemgeneratordir() {
95 - has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX=
96 debug-print-function ${FUNCNAME} "${@}"
97
98 echo "${EPREFIX}$(_systemd_get_systemgeneratordir)"
99 @@ -150,8 +145,7 @@ systemd_get_systemgeneratordir() {
100 # @FUNCTION: systemd_dounit
101 # @USAGE: <unit>...
102 # @DESCRIPTION:
103 -# Install systemd unit(s). Uses doins, thus it is fatal in EAPI 4
104 -# and non-fatal in earlier EAPIs.
105 +# Install systemd unit(s). Uses doins, thus it is fatal.
106 systemd_dounit() {
107 debug-print-function ${FUNCNAME} "${@}"
108
109 @@ -165,8 +159,7 @@ systemd_dounit() {
110 # @FUNCTION: systemd_newunit
111 # @USAGE: <old-name> <new-name>
112 # @DESCRIPTION:
113 -# Install systemd unit with a new name. Uses newins, thus it is fatal
114 -# in EAPI 4 and non-fatal in earlier EAPIs.
115 +# Install systemd unit with a new name. Uses newins, thus it is fatal.
116 systemd_newunit() {
117 debug-print-function ${FUNCNAME} "${@}"
118
119 @@ -180,8 +173,7 @@ systemd_newunit() {
120 # @FUNCTION: systemd_douserunit
121 # @USAGE: <unit>...
122 # @DESCRIPTION:
123 -# Install systemd user unit(s). Uses doins, thus it is fatal in EAPI 4
124 -# and non-fatal in earlier EAPIs.
125 +# Install systemd user unit(s). Uses doins, thus it is fatal.
126 systemd_douserunit() {
127 debug-print-function ${FUNCNAME} "${@}"
128
129 @@ -196,7 +188,7 @@ systemd_douserunit() {
130 # @USAGE: <old-name> <new-name>
131 # @DESCRIPTION:
132 # Install systemd user unit with a new name. Uses newins, thus it
133 -# is fatal in EAPI 4 and non-fatal in earlier EAPIs.
134 +# is fatal.
135 systemd_newuserunit() {
136 debug-print-function ${FUNCNAME} "${@}"
137
138 @@ -241,8 +233,7 @@ systemd_install_serviced() {
139 # @USAGE: <target> <service>
140 # @DESCRIPTION:
141 # Enable service in desired target, e.g. install a symlink for it.
142 -# Uses dosym, thus it is fatal in EAPI 4 and non-fatal in earlier
143 -# EAPIs.
144 +# Uses dosym, thus it is fatal.
145 systemd_enable_service() {
146 debug-print-function ${FUNCNAME} "${@}"
147
148 @@ -265,8 +256,7 @@ systemd_enable_service() {
149 # and name, while the remaining arguments list service units that will
150 # be added to that file.
151 #
152 -# Uses doins, thus it is fatal in EAPI 4 and non-fatal in earlier
153 -# EAPIs.
154 +# Uses doins, thus it is fatal.
155 #
156 # Doc: https://www.freedesktop.org/wiki/Software/systemd/timedated/
157 systemd_enable_ntpunit() {
158 @@ -321,7 +311,7 @@ systemd_enable_ntpunit() {
159 # argument to this function (`$(systemd_with_unitdir systemdunitdir)'). Please
160 # remember to report a bug upstream as well.
161 systemd_with_unitdir() {
162 - [[ ${EAPI:-0} != [012345] ]] && die "${FUNCNAME} is banned in EAPI ${EAPI}, use --with-${1:-systemdsystemunitdir}=\"\$(systemd_get_systemunitdir)\" instead"
163 + [[ ${EAPI} == 5 ]] || die "${FUNCNAME} is banned in EAPI ${EAPI}, use --with-${1:-systemdsystemunitdir}=\"\$(systemd_get_systemunitdir)\" instead"
164
165 debug-print-function ${FUNCNAME} "${@}"
166 local optname=${1:-systemdsystemunitdir}
167 @@ -338,7 +328,7 @@ systemd_with_unitdir() {
168 # systemd helpers. This function always succeeds. Its output may be quoted
169 # in order to preserve whitespace in paths.
170 systemd_with_utildir() {
171 - [[ ${EAPI:-0} != [012345] ]] && die "${FUNCNAME} is banned in EAPI ${EAPI}, use --with-systemdutildir=\"\$(systemd_get_utildir)\" instead"
172 + [[ ${EAPI} == 5 ]] || die "${FUNCNAME} is banned in EAPI ${EAPI}, use --with-systemdutildir=\"\$(systemd_get_utildir)\" instead"
173
174 debug-print-function ${FUNCNAME} "${@}"