diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-07-11 17:33:43 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-07-19 10:24:50 +0100 |
commit | bfd279de3275abbfaf3e630383ec244131e0375f (patch) | |
tree | 0d1c90461a890d21444f5d2afb13c52b302427f1 /meta/classes/useradd.bbclass | |
parent | 99203edda6f0b09d817454d656c100b7a8806b18 (diff) | |
download | poky-bfd279de3275abbfaf3e630383ec244131e0375f.tar.gz |
Convert tab indentation in python functions into four-space
(From OE-Core rev: 604d46c686d06d62d5a07b9c7f4fa170f99307d8)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/useradd.bbclass')
-rw-r--r-- | meta/classes/useradd.bbclass | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/meta/classes/useradd.bbclass b/meta/classes/useradd.bbclass index 6ae5e48420..bb8f42b357 100644 --- a/meta/classes/useradd.bbclass +++ b/meta/classes/useradd.bbclass | |||
@@ -154,61 +154,61 @@ do_package_setscene[depends] = "${USERADDSETSCENEDEPS}" | |||
154 | 154 | ||
155 | # Recipe parse-time sanity checks | 155 | # Recipe parse-time sanity checks |
156 | def update_useradd_after_parse(d): | 156 | def update_useradd_after_parse(d): |
157 | useradd_packages = d.getVar('USERADD_PACKAGES', True) | 157 | useradd_packages = d.getVar('USERADD_PACKAGES', True) |
158 | 158 | ||
159 | if not useradd_packages: | 159 | if not useradd_packages: |
160 | raise bb.build.FuncFailed, "%s inherits useradd but doesn't set USERADD_PACKAGES" % d.getVar('FILE') | 160 | raise bb.build.FuncFailed, "%s inherits useradd but doesn't set USERADD_PACKAGES" % d.getVar('FILE') |
161 | 161 | ||
162 | for pkg in useradd_packages.split(): | 162 | for pkg in useradd_packages.split(): |
163 | if not d.getVar('USERADD_PARAM_%s' % pkg, True) and not d.getVar('GROUPADD_PARAM_%s' % pkg, True): | 163 | if not d.getVar('USERADD_PARAM_%s' % pkg, True) and not d.getVar('GROUPADD_PARAM_%s' % pkg, True): |
164 | raise bb.build.FuncFailed, "%s inherits useradd but doesn't set USERADD_PARAM or GROUPADD_PARAM for package %s" % (d.getVar('FILE'), pkg) | 164 | raise bb.build.FuncFailed, "%s inherits useradd but doesn't set USERADD_PARAM or GROUPADD_PARAM for package %s" % (d.getVar('FILE'), pkg) |
165 | 165 | ||
166 | python __anonymous() { | 166 | python __anonymous() { |
167 | update_useradd_after_parse(d) | 167 | update_useradd_after_parse(d) |
168 | } | 168 | } |
169 | 169 | ||
170 | # Return a single [GROUP|USER]ADD_PARAM formatted string which includes the | 170 | # Return a single [GROUP|USER]ADD_PARAM formatted string which includes the |
171 | # [group|user]add parameters for all USERADD_PACKAGES in this recipe | 171 | # [group|user]add parameters for all USERADD_PACKAGES in this recipe |
172 | def get_all_cmd_params(d, cmd_type): | 172 | def get_all_cmd_params(d, cmd_type): |
173 | import string | 173 | import string |
174 | 174 | ||
175 | param_type = cmd_type.upper() + "ADD_PARAM_%s" | 175 | param_type = cmd_type.upper() + "ADD_PARAM_%s" |
176 | params = [] | 176 | params = [] |
177 | 177 | ||
178 | useradd_packages = d.getVar('USERADD_PACKAGES', True) or "" | 178 | useradd_packages = d.getVar('USERADD_PACKAGES', True) or "" |
179 | for pkg in useradd_packages.split(): | 179 | for pkg in useradd_packages.split(): |
180 | param = d.getVar(param_type % pkg, True) | 180 | param = d.getVar(param_type % pkg, True) |
181 | if param: | 181 | if param: |
182 | params.append(param) | 182 | params.append(param) |
183 | 183 | ||
184 | return string.join(params, "; ") | 184 | return string.join(params, "; ") |
185 | 185 | ||
186 | # Adds the preinst script into generated packages | 186 | # Adds the preinst script into generated packages |
187 | fakeroot python populate_packages_prepend () { | 187 | fakeroot python populate_packages_prepend () { |
188 | def update_useradd_package(pkg): | 188 | def update_useradd_package(pkg): |
189 | bb.debug(1, 'adding user/group calls to preinst for %s' % pkg) | 189 | bb.debug(1, 'adding user/group calls to preinst for %s' % pkg) |
190 | 190 | ||
191 | """ | 191 | """ |
192 | useradd preinst is appended here because pkg_preinst may be | 192 | useradd preinst is appended here because pkg_preinst may be |
193 | required to execute on the target. Not doing so may cause | 193 | required to execute on the target. Not doing so may cause |
194 | useradd preinst to be invoked twice, causing unwanted warnings. | 194 | useradd preinst to be invoked twice, causing unwanted warnings. |
195 | """ | 195 | """ |
196 | preinst = d.getVar('pkg_preinst_%s' % pkg, True) or d.getVar('pkg_preinst', True) | 196 | preinst = d.getVar('pkg_preinst_%s' % pkg, True) or d.getVar('pkg_preinst', True) |
197 | if not preinst: | 197 | if not preinst: |
198 | preinst = '#!/bin/sh\n' | 198 | preinst = '#!/bin/sh\n' |
199 | preinst += d.getVar('useradd_preinst', True) | 199 | preinst += d.getVar('useradd_preinst', True) |
200 | d.setVar('pkg_preinst_%s' % pkg, preinst) | 200 | d.setVar('pkg_preinst_%s' % pkg, preinst) |
201 | 201 | ||
202 | # RDEPENDS setup | 202 | # RDEPENDS setup |
203 | rdepends = d.getVar("RDEPENDS_%s" % pkg, True) or "" | 203 | rdepends = d.getVar("RDEPENDS_%s" % pkg, True) or "" |
204 | rdepends += ' ' + d.getVar('MLPREFIX') + 'base-passwd' | 204 | rdepends += ' ' + d.getVar('MLPREFIX') + 'base-passwd' |
205 | rdepends += ' ' + d.getVar('MLPREFIX') + 'shadow' | 205 | rdepends += ' ' + d.getVar('MLPREFIX') + 'shadow' |
206 | d.setVar("RDEPENDS_%s" % pkg, rdepends) | 206 | d.setVar("RDEPENDS_%s" % pkg, rdepends) |
207 | 207 | ||
208 | # Add the user/group preinstall scripts and RDEPENDS requirements | 208 | # Add the user/group preinstall scripts and RDEPENDS requirements |
209 | # to packages specified by USERADD_PACKAGES | 209 | # to packages specified by USERADD_PACKAGES |
210 | if not bb.data.inherits_class('nativesdk', d): | 210 | if not bb.data.inherits_class('nativesdk', d): |
211 | useradd_packages = d.getVar('USERADD_PACKAGES', True) or "" | 211 | useradd_packages = d.getVar('USERADD_PACKAGES', True) or "" |
212 | for pkg in useradd_packages.split(): | 212 | for pkg in useradd_packages.split(): |
213 | update_useradd_package(pkg) | 213 | update_useradd_package(pkg) |
214 | } | 214 | } |