Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Sun, 20 Jun 2021 21:46:43
Message-Id: 1624225592.f061657d17acbbd516699fe81a6de42851191b3c.sam@gentoo
1 commit: f061657d17acbbd516699fe81a6de42851191b3c
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Wed Mar 31 03:31:05 2021 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sun Jun 20 21:46:32 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f061657d
7
8 user.eclass: change variable reference style for ${1}
9
10 For consistency with the rest of the eclass.
11
12 Signed-off-by: Sam James <sam <AT> gentoo.org>
13
14 eclass/user.eclass | 38 +++++++++++++++++++-------------------
15 1 file changed, 19 insertions(+), 19 deletions(-)
16
17 diff --git a/eclass/user.eclass b/eclass/user.eclass
18 index 2d69da3a651..c86ed53a11d 100644
19 --- a/eclass/user.eclass
20 +++ b/eclass/user.eclass
21 @@ -89,8 +89,8 @@ enewuser() {
22 _assert_pkg_ebuild_phase ${FUNCNAME}
23
24 local create_home=1 force_uid=
25 - while [[ $1 == -* ]]; do
26 - case $1 in
27 + while [[ ${1} == -* ]]; do
28 + case ${1} in
29 -F) force_uid=1;;
30 -M) create_home=;;
31 *) die "${FUNCNAME}: invalid option ${1}";;
32 @@ -99,7 +99,7 @@ enewuser() {
33 done
34
35 # get the username
36 - local euser=$1; shift
37 + local euser=${1}; shift
38 if [[ -z ${euser} ]] ; then
39 eerror "No username specified!"
40 die "Cannot call enewuser without a username"
41 @@ -115,7 +115,7 @@ enewuser() {
42 local opts=()
43
44 # handle uid
45 - local euid=$1; shift
46 + local euid=${1}; shift
47 if [[ -n ${euid} && ${euid} != -1 ]] ; then
48 if [[ ${euid} -gt 0 ]] ; then
49 if [[ -n $(egetent passwd ${euid}) ]] ; then
50 @@ -140,7 +140,7 @@ enewuser() {
51 elog " - Userid: ${euid}"
52
53 # handle shell
54 - local eshell=$1; shift
55 + local eshell=${1}; shift
56 if [[ ! -z ${eshell} ]] && [[ ${eshell} != "-1" ]] ; then
57 if [[ ! -e ${ROOT}${eshell} ]] ; then
58 eerror "A shell was specified but it does not exist!"
59 @@ -157,7 +157,7 @@ enewuser() {
60 opts+=( -s "${eshell}" )
61
62 # handle homedir
63 - local ehome=$1; shift
64 + local ehome=${1}; shift
65 if [[ -z ${ehome} ]] || [[ ${ehome} == "-1" ]] ; then
66 ehome="/dev/null"
67 fi
68 @@ -165,7 +165,7 @@ enewuser() {
69 opts+=( -d "${ehome}" )
70
71 # handle groups
72 - local egroups=$1; shift
73 + local egroups=${1}; shift
74 local g egroups_arr
75 IFS="," read -r -a egroups_arr <<<"${egroups}"
76 if [[ ${#egroups_arr[@]} -gt 0 ]] ; then
77 @@ -244,8 +244,8 @@ enewgroup() {
78 _assert_pkg_ebuild_phase ${FUNCNAME}
79
80 local force_gid=
81 - while [[ $1 == -* ]]; do
82 - case $1 in
83 + while [[ ${1} == -* ]]; do
84 + case ${1} in
85 -F) force_gid=1;;
86 *) die "${FUNCNAME}: invalid option ${1}";;
87 esac
88 @@ -253,7 +253,7 @@ enewgroup() {
89 done
90
91 # get the group
92 - local egroup=$1; shift
93 + local egroup=${1}; shift
94 if [[ -z ${egroup} ]] ; then
95 eerror "No group specified!"
96 die "Cannot call enewgroup without a group"
97 @@ -266,7 +266,7 @@ enewgroup() {
98 elog "Adding group '${egroup}' to your system ..."
99
100 # handle gid
101 - local egid=$1; shift
102 + local egid=${1}; shift
103 if [[ -n ${egid} && ${egid} != -1 ]] ; then
104 if [[ ${egid} -gt 0 ]] ; then
105 if [[ -n $(egetent group ${egid}) ]] ; then
106 @@ -338,7 +338,7 @@ esethome() {
107 _assert_pkg_ebuild_phase ${FUNCNAME}
108
109 # get the username
110 - local euser=$1; shift
111 + local euser=${1}; shift
112 if [[ -z ${euser} ]] ; then
113 eerror "No username specified!"
114 die "Cannot call esethome without a username"
115 @@ -351,7 +351,7 @@ esethome() {
116 fi
117
118 # handle homedir
119 - local ehome=$1; shift
120 + local ehome=${1}; shift
121 if [[ -z ${ehome} ]] ; then
122 eerror "No home directory specified!"
123 die "Cannot call esethome without a home directory or '-1'"
124 @@ -407,7 +407,7 @@ esetshell() {
125 _assert_pkg_ebuild_phase ${FUNCNAME}
126
127 # get the username
128 - local euser=$1; shift
129 + local euser=${1}; shift
130 if [[ -z ${euser} ]] ; then
131 eerror "No username specified!"
132 die "Cannot call esetshell without a username"
133 @@ -420,7 +420,7 @@ esetshell() {
134 fi
135
136 # handle shell
137 - local eshell=$1; shift
138 + local eshell=${1}; shift
139 if [[ -z ${eshell} ]] ; then
140 eerror "No shell specified!"
141 die "Cannot call esetshell without a shell or '-1'"
142 @@ -467,7 +467,7 @@ esetcomment() {
143 _assert_pkg_ebuild_phase ${FUNCNAME}
144
145 # get the username
146 - local euser=$1; shift
147 + local euser=${1}; shift
148 if [[ -z ${euser} ]] ; then
149 eerror "No username specified!"
150 die "Cannot call esetcomment without a username"
151 @@ -480,7 +480,7 @@ esetcomment() {
152 fi
153
154 # handle comment
155 - local ecomment=$1; shift
156 + local ecomment=${1}; shift
157 if [[ -z ${ecomment} ]] ; then
158 eerror "No comment specified!"
159 die "Cannot call esetcomment without a comment"
160 @@ -526,7 +526,7 @@ esetgroups() {
161 [[ ${#} -eq 2 ]] || die "Usage: ${FUNCNAME} <user> <groups>"
162
163 # get the username
164 - local euser=$1; shift
165 + local euser=${1}; shift
166
167 # lets see if the username already exists
168 if [[ -z $(egetent passwd "${euser}") ]] ; then
169 @@ -535,7 +535,7 @@ esetgroups() {
170 fi
171
172 # handle group
173 - local egroups=$1; shift
174 + local egroups=${1}; shift
175
176 local g egroups_arr=()
177 IFS="," read -r -a egroups_arr <<<"${egroups}"