summaryrefslogtreecommitdiff
path: root/bitbake
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2011-01-04 13:06:49 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-01-06 10:49:01 +0000
commit1204ed79fce14115b802012772be8cf8aedff781 (patch)
tree78acc5ef19ad70eb7048acbad4033d7e8d554772 /bitbake
parent74653168c08f4a3cee86e37e8f805ca3d4365e1a (diff)
downloadopenembedded-core-1204ed79fce14115b802012772be8cf8aedff781.tar.gz
openembedded-core-1204ed79fce14115b802012772be8cf8aedff781.tar.bz2
openembedded-core-1204ed79fce14115b802012772be8cf8aedff781.tar.xz
openembedded-core-1204ed79fce14115b802012772be8cf8aedff781.zip
parse.ast: avoid code duplication for inherit
(Bitbake rev: 0b11a3d4eab84b372fd45b9537cf0327008daf8d) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/parse/ast.py11
-rw-r--r--bitbake/lib/bb/process.py6
2 files changed, 6 insertions, 11 deletions
diff --git a/bitbake/lib/bb/parse/ast.py b/bitbake/lib/bb/parse/ast.py
index 55ab48599..fe2674d43 100644
--- a/bitbake/lib/bb/parse/ast.py
+++ b/bitbake/lib/bb/parse/ast.py
@@ -260,11 +260,11 @@ class BBHandlerNode(AstNode):
bb.data.setVar('__BBHANDLERS', bbhands, data)
class InheritNode(AstNode):
- def __init__(self, files):
- self.n = __word__.findall(files)
+ def __init__(self, classes):
+ self.classes = classes
def eval(self, data):
- bb.parse.BBHandler.inherit(self.n, data)
+ bb.parse.BBHandler.inherit(self.classes, data)
def handleInclude(statements, m, fn, lineno, force):
statements.append(IncludeNode(m.group(1), fn, lineno, force))
@@ -300,9 +300,8 @@ def handleBBHandlers(statements, m):
statements.append(BBHandlerNode(m.group(1)))
def handleInherit(statements, m):
- files = m.group(1)
- n = __word__.findall(files)
- statements.append(InheritNode(m.group(1)))
+ classes = m.group(1)
+ statements.append(InheritNode(__word__.findall(classes)))
def finalize(fn, d, variant = None):
for lazykey in bb.data.getVar("__lazy_assigned", d) or ():
diff --git a/bitbake/lib/bb/process.py b/bitbake/lib/bb/process.py
index fd7f28d7a..808cd60f9 100644
--- a/bitbake/lib/bb/process.py
+++ b/bitbake/lib/bb/process.py
@@ -84,17 +84,13 @@ def _logged_communicate(pipe, log, input):
log.write(data)
return ''.join(outdata), ''.join(errdata)
-def run(cmd, input=None, **options):
+def run(cmd, input=None, log=None, **options):
"""Convenience function to run a command and return its output, raising an
exception when the command fails"""
if isinstance(cmd, basestring) and not "shell" in options:
options["shell"] = True
- log = options.get('log')
- if 'log' in options:
- del options['log']
-
try:
pipe = Popen(cmd, **options)
except OSError, exc: