[oe-commits] [openembedded-core] 34/35: useradd.bbclass: Unify writing of script file in useradd_sysroot_sstate()
git at git.openembedded.org
git at git.openembedded.org
Mon Sep 18 10:08:31 UTC 2017
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master
in repository openembedded-core.
commit 0c4259dd3c74d81f20b87417cecb1e636365ce10
Author: Peter Kjellerstedt <peter.kjellerstedt at axis.com>
AuthorDate: Fri Sep 15 16:48:59 2017 +0200
useradd.bbclass: Unify writing of script file in useradd_sysroot_sstate()
There were two identical code blocks for writing the
postinst-useradd-${PN} scripts. This combines them into one.
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt at axis.com>
Signed-off-by: Ross Burton <ross.burton at intel.com>
---
meta/classes/useradd.bbclass | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/meta/classes/useradd.bbclass b/meta/classes/useradd.bbclass
index 0f51e55..686e5fb 100644
--- a/meta/classes/useradd.bbclass
+++ b/meta/classes/useradd.bbclass
@@ -138,22 +138,19 @@ useradd_sysroot () {
EXTRA_STAGING_FIXMES += "COMPONENTS_DIR"
python useradd_sysroot_sstate () {
+ scriptfile = None
task = d.getVar("BB_CURRENTTASK")
if task == "package_setscene":
bb.build.exec_func("useradd_sysroot", d)
elif task == "prepare_recipe_sysroot":
# Used to update this recipe's own sysroot so the user/groups are available to do_install
scriptfile = d.expand("${RECIPE_SYSROOT}${bindir}/postinst-useradd-${PN}")
- bb.utils.mkdirhier(os.path.dirname(scriptfile))
- with open(scriptfile, 'w') as script:
- script.write("#!/bin/sh\n")
- bb.data.emit_func("useradd_sysroot", script, d)
- script.write("useradd_sysroot\n")
- os.chmod(scriptfile, 0o755)
bb.build.exec_func("useradd_sysroot", d)
elif task == "populate_sysroot":
# Used when installed in dependent task sysroots
scriptfile = d.expand("${SYSROOT_DESTDIR}${bindir}/postinst-useradd-${PN}")
+
+ if scriptfile:
bb.utils.mkdirhier(os.path.dirname(scriptfile))
with open(scriptfile, 'w') as script:
script.write("#!/bin/sh\n")
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list