summaryrefslogtreecommitdiff
path: root/scripts/jhbuild/jhbuild2oe.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-11-09 15:00:01 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-11-10 11:35:32 +0000
commitb22831fd63164c4db9c0b72934d7d734a6585251 (patch)
treeedb6581a041190290855bf86714430515c9f235a /scripts/jhbuild/jhbuild2oe.py
parent07ded02ffd37b4fe60a6210dbf56490ea306f0b6 (diff)
downloadopenembedded-core-b22831fd63164c4db9c0b72934d7d734a6585251.tar.gz
openembedded-core-b22831fd63164c4db9c0b72934d7d734a6585251.tar.bz2
openembedded-core-b22831fd63164c4db9c0b72934d7d734a6585251.zip
Convert to use direct access to the data store (instead of bb.data.*Var*())
This is the result of running the following over the metadata: sed \ -e 's:bb.data.\(setVar([^,()]*,[^,()]*\), *\([^ )]*\) *):\2.\1):g' \ -e 's:bb.data.\(setVarFlag([^,()]*,[^,()]*,[^,()]*\), *\([^) ]*\) *):\2.\1):g' \ -e 's:bb.data.\(getVar([^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \ -e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^(), ]*\) *,\([^)]*\)):\2.\1,\3):g' \ -e 's:bb.data.\(getVarFlag([^,()]*,[^,()]*\), *\([^() ]*\) *):\2.\1):g' \ -e 's:bb.data.\(getVar([^,()]*\), *\([^) ]*\) *):\2.\1):g' \ -i `grep -ril bb.data *` Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/jhbuild/jhbuild2oe.py')
-rwxr-xr-xscripts/jhbuild/jhbuild2oe.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/scripts/jhbuild/jhbuild2oe.py b/scripts/jhbuild/jhbuild2oe.py
index ef292763de..9b31cafb69 100755
--- a/scripts/jhbuild/jhbuild2oe.py
+++ b/scripts/jhbuild/jhbuild2oe.py
@@ -161,9 +161,9 @@ class Handlers(object):
# create the package
d = bb.data.init()
pn = self.packagename(element.attrib.get('id'))
- bb.data.setVar('PN', pn, d)
+ d.setVar('PN', pn)
bb.data.setVar('DEPENDS', ' '.join(deps), d)
- bb.data.setVar('_handler', 'metamodule', d)
+ d.setVar('_handler', 'metamodule')
self.packages.append(d)
def autotools(self, element, parent):
@@ -181,23 +181,23 @@ class Handlers(object):
if id is None:
raise Exception('Error: autotools element has no id attribute.')
pn = self.packagename(id)
- bb.data.setVar('PN', pn, d)
+ d.setVar('PN', pn)
if deps is not None:
bb.data.setVar('DEPENDS', ' '.join(deps), d)
if branch is not None:
# <branch repo="git.freedesktop.org" module="xorg/xserver"/>
repo = os.path.join(self.repositories[branch.attrib.get('repo')], branch.attrib.get('module'))
- bb.data.setVar('SRC_URI', repo, d)
+ d.setVar('SRC_URI', repo)
checkoutdir = branch.attrib.get('checkoutdir')
if checkoutdir is not None:
bb.data.setVar('S', os.path.join('${WORKDIR}', checkoutdir), d)
# build class
- bb.data.setVar('INHERITS', 'autotools', d)
- bb.data.setVarFlag('INHERITS', 'operator', '+=', d)
- bb.data.setVar('_handler', 'autotools', d)
+ d.setVar('INHERITS', 'autotools')
+ d.setVarFlag('INHERITS', 'operator', '+=')
+ d.setVar('_handler', 'autotools')
self.packages.append(d)
class Emitter(object):
@@ -209,7 +209,7 @@ class Emitter(object):
def __init__(self, filefunc = None, basedir = None):
def _defaultfilefunc(package):
# return a relative path to the bitbake .bb which will be written
- return bb.data.getVar('PN', package, 1) + '.bb'
+ return package.getVar('PN', 1) + '.bb'
self.filefunc = filefunc or _defaultfilefunc
self.basedir = basedir or os.path.abspath(os.curdir)
@@ -226,16 +226,16 @@ class Emitter(object):
f.close()
for key in bb.data.keys(package):
- fdata = fdata.replace('@@'+key+'@@', bb.data.getVar(key, package))
+ fdata = fdata.replace('@@'+key+'@@', package.getVar(key))
else:
for key in bb.data.keys(package):
if key == '_handler':
continue
elif key == 'INHERITS':
- fdata += 'inherit %s\n' % bb.data.getVar('INHERITS', package)
+ fdata += 'inherit %s\n' % package.getVar('INHERITS')
else:
- oper = bb.data.getVarFlag(key, 'operator', package) or '='
- fdata += '%s %s "%s"\n' % (key, oper, bb.data.getVar(key, package))
+ oper = package.getVarFlag(key, 'operator') or '='
+ fdata += '%s %s "%s"\n' % (key, oper, package.getVar(key))
if not os.path.exists(os.path.join(self.basedir, os.path.dirname(self.filefunc(package)))):
os.makedirs(os.path.join(self.basedir, os.path.dirname(self.filefunc(package))))
@@ -254,8 +254,8 @@ def _test():
def filefunc(package):
# return a relative path to the bitbake .bb which will be written
- src_uri = bb.data.getVar('SRC_URI', package, 1)
- filename = bb.data.getVar('PN', package, 1) + '.bb'
+ src_uri = package.getVar('SRC_URI', 1)
+ filename = package.getVar('PN', 1) + '.bb'
if not src_uri:
return filename
else: