1 |
commit: 6321148ad3c045fc63e9b9e8b53f26a1a1abbc6f |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Apr 30 06:33:28 2011 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Apr 30 06:33:28 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=6321148a |
7 |
|
8 |
[eclass] Docs. |
9 |
|
10 |
--- |
11 |
eclass/systemd.eclass | 11 +++++++++-- |
12 |
1 files changed, 9 insertions(+), 2 deletions(-) |
13 |
|
14 |
diff --git a/eclass/systemd.eclass b/eclass/systemd.eclass |
15 |
index 5325e68..517026a 100644 |
16 |
--- a/eclass/systemd.eclass |
17 |
+++ b/eclass/systemd.eclass |
18 |
@@ -20,6 +20,7 @@ esac |
19 |
# @FUNCTION: systemd_get_unitdir |
20 |
# @DESCRIPTION: |
21 |
# Output the path for the systemd unit directory (not including ${D}). |
22 |
+# This function always succeeds, even if systemd is not installed. |
23 |
systemd_get_unitdir() { |
24 |
debug-print-function ${FUNCNAME} "${@}" |
25 |
|
26 |
@@ -29,7 +30,8 @@ systemd_get_unitdir() { |
27 |
# @FUNCTION: systemd_dounit |
28 |
# @USAGE: unit1 [...] |
29 |
# @DESCRIPTION: |
30 |
-# Install systemd unit(s). |
31 |
+# Install systemd unit(s). Uses doins, thus it is fatal in EAPI 4 |
32 |
+# and non-fatal in earlier EAPIs. |
33 |
systemd_dounit() { |
34 |
debug-print-function ${FUNCNAME} "${@}" |
35 |
|
36 |
@@ -43,9 +45,13 @@ systemd_dounit() { |
37 |
# @USAGE: target service |
38 |
# @DESCRIPTION: |
39 |
# Enable service in desired target, e.g. install a symlink for it. |
40 |
+# Uses dosym, thus it is fatal in EAPI 4 and non-fatal in earlier |
41 |
+# EAPIs. |
42 |
systemd_enable_service() { |
43 |
debug-print-function ${FUNCNAME} "${@}" |
44 |
|
45 |
+ [[ ${#} -eq 2 ]] || die "Synopsis: systemd_enable_service target service" |
46 |
+ |
47 |
local target=${1} |
48 |
local service=${2} |
49 |
local ud=$(systemd_get_unitdir) |
50 |
@@ -57,7 +63,8 @@ systemd_enable_service() { |
51 |
# @FUNCTION: systemd_with_unitdir |
52 |
# @DESCRIPTION: |
53 |
# Output '--with-systemdsystemunitdir' as expected by systemd-aware configure |
54 |
-# scripts. |
55 |
+# scripts. This function always succeeds. Its output may be quoted in order |
56 |
+# to preserve whitespace in paths. |
57 |
systemd_with_unitdir() { |
58 |
debug-print-function ${FUNCNAME} "${@}" |