Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Mon, 02 Jan 2023 22:02:24
Message-Id: 1672696898.649cc28861ee5a66ef1eb5b1aafc2759a45bbe7d.soap@gentoo
1 commit: 649cc28861ee5a66ef1eb5b1aafc2759a45bbe7d
2 Author: David Seifert <soap <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jan 2 22:01:38 2023 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Mon Jan 2 22:01:38 2023 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=649cc288
7
8 s6.eclass: consistent style
9
10 Closes: https://github.com/gentoo/gentoo/pull/28912
11 Signed-off-by: David Seifert <soap <AT> gentoo.org>
12
13 eclass/s6.eclass | 42 ++++++++++++++++++++----------------------
14 1 file changed, 20 insertions(+), 22 deletions(-)
15
16 diff --git a/eclass/s6.eclass b/eclass/s6.eclass
17 index f4d7ebf2c31d..56b321f178f6 100644
18 --- a/eclass/s6.eclass
19 +++ b/eclass/s6.eclass
20 @@ -42,7 +42,7 @@ _s6_get_servicedir() {
21 # @DESCRIPTION:
22 # Output the path for the s6 service directory (not including ${D}).
23 s6_get_servicedir() {
24 - debug-print-function ${FUNCNAME} "${@}"
25 + debug-print-function ${FUNCNAME} "$@"
26
27 echo "${EPREFIX}$(_s6_get_servicedir)"
28 }
29 @@ -55,22 +55,22 @@ s6_get_servicedir() {
30 # run is the run script for the service.
31 # finish is the optional finish script for the service.
32 s6_install_service() {
33 - debug-print-function ${FUNCNAME} "${@}"
34 + debug-print-function ${FUNCNAME} "$@"
35
36 local name="$1"
37 local run="$2"
38 local finish="$3"
39
40 - [[ $name ]] ||
41 + [[ -z ${name} ]] &&
42 die "${ECLASS}.eclass: you must specify the s6 service name"
43 - [[ $run ]] ||
44 + [[ -z ${run} ]] &&
45 die "${ECLASS}.eclass: you must specify the s6 service run script"
46
47 (
48 - local servicepath="$(_s6_get_servicedir)/$name"
49 - exeinto "$servicepath"
50 - newexe "$run" run
51 - [[ $finish ]] && newexe "$finish" finish
52 + local servicepath="$(_s6_get_servicedir)/${name}"
53 + exeinto "${servicepath}"
54 + newexe "${run}" run
55 + [[ -n ${finish} ]] && newexe "${finish}" finish
56 )
57 }
58
59 @@ -81,18 +81,17 @@ s6_install_service() {
60 # default.
61 # servicename is the name of the service.
62 s6_service_down() {
63 - debug-print-function ${FUNCNAME} "${@}"
64 + debug-print-function ${FUNCNAME} "$@"
65
66 local name="$1"
67 -
68 - [[ $name ]] ||
69 + [[ -z ${name} ]] &&
70 die "${ECLASS}.eclass: you must specify the s6 service name"
71
72 (
73 - touch "$T"/down || die
74 - local servicepath="$(_s6_get_servicedir)/$name"
75 - insinto "$servicepath"
76 - doins "$T"/down
77 + touch "${T}"/down || die
78 + local servicepath="$(_s6_get_servicedir)/${name}"
79 + insinto "${servicepath}"
80 + doins "${T}"/down
81 )
82 }
83
84 @@ -103,17 +102,16 @@ s6_service_down() {
85 # leader.
86 # servicename is the name of the service.
87 s6_service_nosetsid() {
88 - debug-print-function ${FUNCNAME} "${@}"
89 + debug-print-function ${FUNCNAME} "$@"
90
91 local name="$1"
92 -
93 - [[ $name ]] ||
94 + [[ -z ${name} ]] &&
95 die "${ECLASS}.eclass: you must specify the s6 service name"
96
97 (
98 - touch "$T"/nosetsid || die
99 - local servicepath="$(_s6_get_servicedir)/$name"
100 - insinto "$servicepath"
101 - doins "$T"/nosetsid
102 + touch "${T}"/nosetsid || die
103 + local servicepath="$(_s6_get_servicedir)/${name}"
104 + insinto "${servicepath}"
105 + doins "${T}"/nosetsid
106 )
107 }