Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH systemd.eclass] Use local variables instead of subshelling for do*() and new*().
Date: Mon, 12 Nov 2012 20:30:11
Message-Id: 1352752220-8456-1-git-send-email-mgorny@gentoo.org
1 ---
2 gx86/eclass/systemd.eclass | 28 ++++++++++++----------------
3 1 file changed, 12 insertions(+), 16 deletions(-)
4
5 diff --git a/gx86/eclass/systemd.eclass b/gx86/eclass/systemd.eclass
6 index 47e342b..bb1ec7f 100644
7 --- a/gx86/eclass/systemd.eclass
8 +++ b/gx86/eclass/systemd.eclass
9 @@ -69,10 +69,9 @@ systemd_get_utildir() {
10 systemd_dounit() {
11 debug-print-function ${FUNCNAME} "${@}"
12
13 - (
14 - insinto "$(_systemd_get_unitdir)"
15 - doins "${@}"
16 - )
17 + local INSDESTTREE
18 + insinto "$(_systemd_get_unitdir)"
19 + doins "${@}"
20 }
21
22 # @FUNCTION: systemd_newunit
23 @@ -83,10 +82,9 @@ systemd_dounit() {
24 systemd_newunit() {
25 debug-print-function ${FUNCNAME} "${@}"
26
27 - (
28 - insinto "$(_systemd_get_unitdir)"
29 - newins "${@}"
30 - )
31 + local INSDESTTREE
32 + insinto "$(_systemd_get_unitdir)"
33 + newins "${@}"
34 }
35
36 # @FUNCTION: systemd_dotmpfilesd
37 @@ -102,10 +100,9 @@ systemd_dotmpfilesd() {
38 || die 'tmpfiles.d files need to have .conf suffix.'
39 done
40
41 - (
42 - insinto /usr/lib/tmpfiles.d/
43 - doins "${@}"
44 - )
45 + local INSDESTTREE
46 + insinto /usr/lib/tmpfiles.d/
47 + doins "${@}"
48 }
49
50 # @FUNCTION: systemd_newtmpfilesd
51 @@ -119,10 +116,9 @@ systemd_newtmpfilesd() {
52 [[ ${2} == *.conf ]] \
53 || die 'tmpfiles.d files need to have .conf suffix.'
54
55 - (
56 - insinto /usr/lib/tmpfiles.d/
57 - newins "${@}"
58 - )
59 + local INSDESTTREE
60 + insinto /usr/lib/tmpfiles.d/
61 + newins "${@}"
62 }
63
64 # @FUNCTION: systemd_enable_service
65 --
66 1.8.0

Replies