From: Ed Bartosh Date: Wed, 6 Apr 2016 16:46:23 +0000 (+0100) Subject: toaster: add new parameter to _shellcmd X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=89fae3c8712bfaac48686c58b480e40c1abdcfdc;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git toaster: add new parameter to _shellcmd Added 'nowait' parameter to _shellcmd method to support running chain of commands in a subshell. This is going to be used to stop bitbake server after the build. Signed-off-by: Ed Bartosh Signed-off-by: Michael Wood Signed-off-by: Richard Purdie --- diff --git a/lib/toaster/bldcontrol/localhostbecontroller.py b/lib/toaster/bldcontrol/localhostbecontroller.py index 2e3aa37d010..ed466363729 100644 --- a/lib/toaster/bldcontrol/localhostbecontroller.py +++ b/lib/toaster/bldcontrol/localhostbecontroller.py @@ -51,12 +51,14 @@ class LocalhostBEController(BuildEnvironmentController): self.pokydirname = None self.islayerset = False - def _shellcmd(self, command, cwd = None): + def _shellcmd(self, command, cwd=None, nowait=False): if cwd is None: cwd = self.be.sourcedir logger.debug("lbc_shellcmmd: (%s) %s" % (cwd, command)) p = subprocess.Popen(command, cwd = cwd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + if nowait: + return (out,err) = p.communicate() p.wait() if p.returncode: