1 |
commit: 742bcd6875a618c936bd0afe9d49d8725aa872b6 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Nov 30 14:48:49 2015 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Dec 1 22:07:17 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=742bcd68 |
7 |
|
8 |
systemd.eclass: systemd_get_unitdir -> *systemunitdir for consistency |
9 |
|
10 |
Rename systemd_get_unitdir to systemd_get_systemunitdir for consistency |
11 |
with other functions. Ban the old name in EAPI 6 onwards. |
12 |
|
13 |
eclass/systemd.eclass | 34 ++++++++++++++++++++++------------ |
14 |
1 file changed, 22 insertions(+), 12 deletions(-) |
15 |
|
16 |
diff --git a/eclass/systemd.eclass b/eclass/systemd.eclass |
17 |
index 245e803..7dd914a 100644 |
18 |
--- a/eclass/systemd.eclass |
19 |
+++ b/eclass/systemd.eclass |
20 |
@@ -58,19 +58,29 @@ _systemd_get_dir() { |
21 |
# @INTERNAL |
22 |
# @DESCRIPTION: |
23 |
# Get unprefixed unitdir. |
24 |
-_systemd_get_unitdir() { |
25 |
+_systemd_get_systemunitdir() { |
26 |
_systemd_get_dir systemdsystemunitdir /usr/lib/systemd/system |
27 |
} |
28 |
|
29 |
-# @FUNCTION: systemd_get_unitdir |
30 |
+# @FUNCTION: systemd_get_systemunitdir |
31 |
# @DESCRIPTION: |
32 |
-# Output the path for the systemd unit directory (not including ${D}). |
33 |
-# This function always succeeds, even if systemd is not installed. |
34 |
-systemd_get_unitdir() { |
35 |
+# Output the path for the systemd system unit directory (not including |
36 |
+# ${D}). This function always succeeds, even if systemd is not |
37 |
+# installed. |
38 |
+systemd_get_systemunitdir() { |
39 |
has "${EAPI:-0}" 0 1 2 && ! use prefix && EPREFIX= |
40 |
debug-print-function ${FUNCNAME} "${@}" |
41 |
|
42 |
- echo "${EPREFIX}$(_systemd_get_unitdir)" |
43 |
+ echo "${EPREFIX}$(_systemd_get_systemunitdir)" |
44 |
+} |
45 |
+ |
46 |
+# @FUNCTION: systemd_get_unitdir |
47 |
+# @DESCRIPTION: |
48 |
+# Deprecated alias for systemd_get_systemunitdir. |
49 |
+systemd_get_unitdir() { |
50 |
+ [[ ${EAPI} == [012345] ]] || die "${FUNCNAME} is banned in EAPI 6, use systemd_get_systemunitdir instead" |
51 |
+ |
52 |
+ systemd_get_systemunitdir |
53 |
} |
54 |
|
55 |
# @FUNCTION: _systemd_get_userunitdir |
56 |
@@ -122,7 +132,7 @@ systemd_dounit() { |
57 |
debug-print-function ${FUNCNAME} "${@}" |
58 |
|
59 |
( |
60 |
- insinto "$(_systemd_get_unitdir)" |
61 |
+ insinto "$(_systemd_get_systemunitdir)" |
62 |
doins "${@}" |
63 |
) |
64 |
} |
65 |
@@ -136,7 +146,7 @@ systemd_newunit() { |
66 |
debug-print-function ${FUNCNAME} "${@}" |
67 |
|
68 |
( |
69 |
- insinto "$(_systemd_get_unitdir)" |
70 |
+ insinto "$(_systemd_get_systemunitdir)" |
71 |
newins "${@}" |
72 |
) |
73 |
} |
74 |
@@ -247,7 +257,7 @@ systemd_enable_service() { |
75 |
|
76 |
local target=${1} |
77 |
local service=${2} |
78 |
- local ud=$(_systemd_get_unitdir) |
79 |
+ local ud=$(_systemd_get_systemunitdir) |
80 |
local destname=${service##*/} |
81 |
|
82 |
dodir "${ud}"/"${target}".wants && \ |
83 |
@@ -281,7 +291,7 @@ systemd_enable_ntpunit() { |
84 |
die "The .list suffix is appended implicitly to ntpunit.d name." |
85 |
fi |
86 |
|
87 |
- local unitdir=$(systemd_get_unitdir) |
88 |
+ local unitdir=$(systemd_get_systemunitdir) |
89 |
local s |
90 |
for s in "${services[@]}"; do |
91 |
if [[ ! -f "${D}${unitdir}/${s}" ]]; then |
92 |
@@ -317,7 +327,7 @@ systemd_with_unitdir() { |
93 |
debug-print-function ${FUNCNAME} "${@}" |
94 |
local optname=${1:-systemdsystemunitdir} |
95 |
|
96 |
- echo --with-${optname}="$(systemd_get_unitdir)" |
97 |
+ echo --with-${optname}="$(systemd_get_systemunitdir)" |
98 |
} |
99 |
|
100 |
# @FUNCTION: systemd_with_utildir |
101 |
@@ -344,7 +354,7 @@ systemd_to_myeconfargs() { |
102 |
|
103 |
myeconfargs=( |
104 |
"${myeconfargs[@]}" |
105 |
- --with-systemdsystemunitdir="$(systemd_get_unitdir)" |
106 |
+ --with-systemdsystemunitdir="$(systemd_get_systemunitdir)" |
107 |
) |
108 |
} |