summaryrefslogtreecommitdiffstats
path: root/scripts/jhbuild
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/jhbuild')
-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):
161 # create the package 161 # create the package
162 d = bb.data.init() 162 d = bb.data.init()
163 pn = self.packagename(element.attrib.get('id')) 163 pn = self.packagename(element.attrib.get('id'))
164 bb.data.setVar('PN', pn, d) 164 d.setVar('PN', pn)
165 bb.data.setVar('DEPENDS', ' '.join(deps), d) 165 bb.data.setVar('DEPENDS', ' '.join(deps), d)
166 bb.data.setVar('_handler', 'metamodule', d) 166 d.setVar('_handler', 'metamodule')
167 self.packages.append(d) 167 self.packages.append(d)
168 168
169 def autotools(self, element, parent): 169 def autotools(self, element, parent):
@@ -181,23 +181,23 @@ class Handlers(object):
181 if id is None: 181 if id is None:
182 raise Exception('Error: autotools element has no id attribute.') 182 raise Exception('Error: autotools element has no id attribute.')
183 pn = self.packagename(id) 183 pn = self.packagename(id)
184 bb.data.setVar('PN', pn, d) 184 d.setVar('PN', pn)
185 if deps is not None: 185 if deps is not None:
186 bb.data.setVar('DEPENDS', ' '.join(deps), d) 186 bb.data.setVar('DEPENDS', ' '.join(deps), d)
187 187
188 if branch is not None: 188 if branch is not None:
189 # <branch repo="git.freedesktop.org" module="xorg/xserver"/> 189 # <branch repo="git.freedesktop.org" module="xorg/xserver"/>
190 repo = os.path.join(self.repositories[branch.attrib.get('repo')], branch.attrib.get('module')) 190 repo = os.path.join(self.repositories[branch.attrib.get('repo')], branch.attrib.get('module'))
191 bb.data.setVar('SRC_URI', repo, d) 191 d.setVar('SRC_URI', repo)
192 192
193 checkoutdir = branch.attrib.get('checkoutdir') 193 checkoutdir = branch.attrib.get('checkoutdir')
194 if checkoutdir is not None: 194 if checkoutdir is not None:
195 bb.data.setVar('S', os.path.join('${WORKDIR}', checkoutdir), d) 195 bb.data.setVar('S', os.path.join('${WORKDIR}', checkoutdir), d)
196 196
197 # build class 197 # build class
198 bb.data.setVar('INHERITS', 'autotools', d) 198 d.setVar('INHERITS', 'autotools')
199 bb.data.setVarFlag('INHERITS', 'operator', '+=', d) 199 d.setVarFlag('INHERITS', 'operator', '+=')
200 bb.data.setVar('_handler', 'autotools', d) 200 d.setVar('_handler', 'autotools')
201 self.packages.append(d) 201 self.packages.append(d)
202 202
203class Emitter(object): 203class Emitter(object):
@@ -209,7 +209,7 @@ class Emitter(object):
209 def __init__(self, filefunc = None, basedir = None): 209 def __init__(self, filefunc = None, basedir = None):
210 def _defaultfilefunc(package): 210 def _defaultfilefunc(package):
211 # return a relative path to the bitbake .bb which will be written 211 # return a relative path to the bitbake .bb which will be written
212 return bb.data.getVar('PN', package, 1) + '.bb' 212 return package.getVar('PN', 1) + '.bb'
213 213
214 self.filefunc = filefunc or _defaultfilefunc 214 self.filefunc = filefunc or _defaultfilefunc
215 self.basedir = basedir or os.path.abspath(os.curdir) 215 self.basedir = basedir or os.path.abspath(os.curdir)
@@ -226,16 +226,16 @@ class Emitter(object):
226 f.close() 226 f.close()
227 227
228 for key in bb.data.keys(package): 228 for key in bb.data.keys(package):
229 fdata = fdata.replace('@@'+key+'@@', bb.data.getVar(key, package)) 229 fdata = fdata.replace('@@'+key+'@@', package.getVar(key))
230 else: 230 else:
231 for key in bb.data.keys(package): 231 for key in bb.data.keys(package):
232 if key == '_handler': 232 if key == '_handler':
233 continue 233 continue
234 elif key == 'INHERITS': 234 elif key == 'INHERITS':
235 fdata += 'inherit %s\n' % bb.data.getVar('INHERITS', package) 235 fdata += 'inherit %s\n' % package.getVar('INHERITS')
236 else: 236 else:
237 oper = bb.data.getVarFlag(key, 'operator', package) or '=' 237 oper = package.getVarFlag(key, 'operator') or '='
238 fdata += '%s %s "%s"\n' % (key, oper, bb.data.getVar(key, package)) 238 fdata += '%s %s "%s"\n' % (key, oper, package.getVar(key))
239 239
240 if not os.path.exists(os.path.join(self.basedir, os.path.dirname(self.filefunc(package)))): 240 if not os.path.exists(os.path.join(self.basedir, os.path.dirname(self.filefunc(package)))):
241 os.makedirs(os.path.join(self.basedir, os.path.dirname(self.filefunc(package)))) 241 os.makedirs(os.path.join(self.basedir, os.path.dirname(self.filefunc(package))))
@@ -254,8 +254,8 @@ def _test():
254 254
255 def filefunc(package): 255 def filefunc(package):
256 # return a relative path to the bitbake .bb which will be written 256 # return a relative path to the bitbake .bb which will be written
257 src_uri = bb.data.getVar('SRC_URI', package, 1) 257 src_uri = package.getVar('SRC_URI', 1)
258 filename = bb.data.getVar('PN', package, 1) + '.bb' 258 filename = package.getVar('PN', 1) + '.bb'
259 if not src_uri: 259 if not src_uri:
260 return filename 260 return filename
261 else: 261 else: